const morgan = require('morgan');
const bodyParser = require('body-parser');
const exphbs = require('express-handlebars');
const cookieParser = require('cookie-parser');
const session = require('express-session');
const RedisStore = require('connect-redis')(session);
const express = require('express');
const app = express();

/**
 * 监控
 */
app.get('/watch', function (req, res) {
  return res.send({success: true});
});

let config = require('../config');
let utils = require('./utils');
let cache = require('./utils/cache').newInstance();
let redis = require('./utils/redis')(config.redis);
let qiniu = require('./utils/qiniu')(config);
let search = require('./utils/search')(config.elasticsearch);
let taobaoApi = require('./taobao')(config);
let models = require('./models').newInstance(config.mysql);
let modelsData = require('./models_data').newInstance(config.mysql_data);

let storage = {
  cache: cache,
  redis: redis,
  qiniu: qiniu,
  search: search,
  models: models,
  modelsData: modelsData,
  utils: utils,
  controller: utils.controller,
  sms: utils.sms,
  config: config,
  paths: config.paths,
  taobaoApi: taobaoApi
};

/**
 * 设置静态目录
 */
let resourcesPath;
if (config.client_dist) {
  resourcesPath = config.paths.dist;
} else {
  app.use('/', express.static(config.paths.bower));
  resourcesPath = config.paths.client;
}
app.use('/', express.static(resourcesPath + 'duolingbao'));
app.use('/', express.static(resourcesPath + 'admin'));
app.use('/', express.static(resourcesPath + 'front'));
app.use('/', express.static(config.paths.public));
app.use('/', express.static(resourcesPath));

/**
 * 设置模板引擎
 */
app.engine('handlebars', exphbs({
  helpers: utils.hbs(resourcesPath + '/templates/'),
  defaultLayout: false,
  layoutsDir: resourcesPath,
  partialsDir: resourcesPath
}));
app.set('view engine', 'handlebars');
app.set('views', resourcesPath);

/**
 * 扩展访问日志
 */
let getClientIp = function (req) {
  return req.headers['x-forwarded-for'] || (req.connection.remoteAddress || '').replace('::ffff:', '');
}
{
  morgan.token('client-ip', getClientIp);
  morgan.token('user-id', function getSessionId(req) {
    return req.session && req.session.user_id;
  });
}

app.use(morgan(config.morgan));
app.use(bodyParser.urlencoded({extended: false}));
app.use(bodyParser.json());
app.use(cookieParser());
app.use(session({
  name: config.sid,
  secret: config.secret,
  resave: false,
  saveUninitialized: true,
  store: new RedisStore({client: redis.globalClient})
}));

/**
 * 用户访问日志
 */
app.use(function (req, res, next) {
  if (req.session.user_id && !req.session.client_ip) {
    let clientId = getClientIp(req);
    if (clientId) {
      req.session.client_ip = clientId;
      req.session.touch();

      storage.models.VisitsLogs.create({
        user_id: req.session.user_id,
        ip: clientId
      });
    }
  }
  next();
});

/**
 * 订阅事件
 */
let handlers = {
  settings_update: function () {
    return storage.models.Settings.findToMapV2(true).then(function (settings) {
      storage.cache.settings.init(settings);
    });
  },
  dicts_update: function () {
    return storage.models.Dicts.findAll({
      order: [['order_by', 'asc'], ['id', 'asc']], attributes: {exclude: ['created_at', 'updated_at']},
      raw: true
    }).then(function (rows) {
      storage.cache.dicts.init(rows);
    });
  }
}
redis.sub.on("message", function (channel, message) {
  if (channel === 'settings_update') {
    return handlers.settings_update();
  } else if (channel === 'dicts_update') {
    return handlers.dicts_update();
  }
});
redis.sub.subscribe('settings_update');
redis.sub.subscribe('dicts_update');
handlers.settings_update();
handlers.dicts_update();

/**
 * Admin Apis
 */
app.use('/api/admin', require('./api/admin')(storage, config));

/**
 * Public Apis
 */
app.use('/api/public', require('./api/public')(storage, config));

/**
 * Front Apis
 */
app.use('/api/front', require('./api/front')(storage, config));

/**
 * Webservice Api
 */
app.use('/api/webservice', require('./api/webservice')(storage, config));

/**
 * Pages
 */
app.use('/', require('./api/pages')(storage, config));

/**
 * 测试
 */
app.use('/test', function (req, res, next) {
  console.log('req.query', req.query);
  console.log('req.body', req.body);

  return res.json({
    query: req.query,
    body: req.body
  });
});

/**
 * 退出登录
 */
app.use('/logout', function (req, res, next) {
  let session = req.session;
  session.cookie.expires = false;
  session.user_id = 0;
  session.touch();
  return res.redirect('/');
});


const x = function (e) {
  return typeof e
};

const o = function () {
  return function (t) {
    var n = {};

    function r(e) {
      if (n[e])
        return n[e].exports;
      var i = n[e] = {
        i: e,
        l: !1,
        exports: {}
      };
      return t[e].call(i.exports, i, i.exports, r),
        i.l = !0,
        i.exports
    }

    return r.m = t,
      r.c = n,
      r.d = function (t, n, e) {
        r.o(t, n) || p(t, n, {
          enumerable: !0,
          get: e
        })
      }
      ,
      r.r = function (t) {
        void 0 !== _ && d && p(t, d, {
          value: "Module"
        }),
          Object.defineProperty(t, "__esModule", {
            value: !0
          })
      }
      ,
      r.t = function (t, n) {
        if (1 & n && (t = r(t)),
        8 & n)
          return t;
        if (4 & n && "object" == x(t) && t && t.__esModule)
          return t;
        var e = l(null);
        if (r.r(e),
          Object.defineProperty(e, "default", {
            enumerable: !0,
            value: t
          }),
        2 & n && "string" != typeof t)
          for (var i in t)
            r.d(e, i, function (n) {
              return t[n]
            }
              .bind(null, i));
        return e
      }
      ,
      r.n = function (t) {
        var n = t && t.__esModule ? function () {
            return t.default
          }
          : function () {
            return t
          }
        ;
        return r.d(n, "a", n),
          n
      }
      ,
      r.o = function (t, n) {
        return Object.prototype.hasOwnProperty.call(t, n)
      }
      ,
      r.p = "",
      r(r.s = 5)
  }(
    [
      function (t, n, r) {
        "use strict";
        var e = "function" == typeof _ && "symbol" == x(w) ? function (t) {
            return x(t)
          }
          : function (t) {
            return t && "function" == typeof _ && t.constructor === _ && t !== _.prototype ? "symbol" : x(t)
          }
          ,
          i = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array;

        function a(t, n) {
          return Object.prototype.hasOwnProperty.call(t, n)
        }

        n.assign = function (t) {
          for (var n = Array.prototype.slice.call(arguments, 1); n.length;) {
            var r = n.shift();
            if (r) {
              if ("object" !== (void 0 === r ? "undefined" : e(r)))
                throw new TypeError(r + "must be non-object");
              for (var i in r)
                a(r, i) && (t[i] = r[i])
            }
          }
          return t
        }
          ,
          n.shrinkBuf = function (t, n) {
            return t.length === n ? t : t.subarray ? t.subarray(0, n) : (t.length = n,
              t)
          }
        ;
        var o = {
          arraySet: function (t, n, r, e, i) {
            if (n.subarray && t.subarray)
              t.set(n.subarray(r, r + e), i);
            else
              for (var a = 0; a < e; a++)
                t[i + a] = n[r + a]
          },
          flattenChunks: function (t) {
            var n, r, e, i, a, o;
            for (e = 0,
                   n = 0,
                   r = t.length; n < r; n++)
              e += t[n].length;
            for (o = new Uint8Array(e),
                   i = 0,
                   n = 0,
                   r = t.length; n < r; n++)
              a = t[n],
                o.set(a, i),
                i += a.length;
            return o
          }
        }
          , s = {
          arraySet: function (t, n, r, e, i) {
            for (var a = 0; a < e; a++)
              t[i + a] = n[r + a]
          },
          flattenChunks: function (t) {
            return [].concat.apply([], t)
          }
        };
        n.setTyped = function (t) {
          t ? (n.Buf8 = Uint8Array,
            n.Buf16 = Uint16Array,
            n.Buf32 = Int32Array,
            n.assign(n, o)) : (n.Buf8 = Array,
            n.Buf16 = Array,
            n.Buf32 = Array,
            n.assign(n, s))
        }
          ,
          n.setTyped(i)
      }
      , function (t, n) {
      t.exports = function (t) {
        return t.webpackPolyfill || (t.deprecate = function () {
        }
          ,
          t.paths = [],
        t.children || (t.children = []),
          Object.defineProperty(t, "loaded", {
            enumerable: !0,
            get: function () {
              return t.l
            }
          }),
          Object.defineProperty(t, "id", {
            enumerable: !0,
            get: function () {
              return t.i
            }
          }),
          t.webpackPolyfill = 1),
          t
      }
    }
      , function (t, n) {
      var r = {
        utf8: {
          stringToBytes: function (t) {
            return r.bin.stringToBytes(unescape(encodeURIComponent(t)))
          },
          bytesToString: function (t) {
            return decodeURIComponent(escape(r.bin.bytesToString(t)))
          }
        },
        bin: {
          stringToBytes: function (t) {
            for (var n = [], r = 0; r < t.length; r++)
              n.push(255 & t.charCodeAt(r));
            return n
          },
          bytesToString: function (t) {
            for (var n = [], r = 0; r < t.length; r++)
              n.push(String.fromCharCode(t[r]));
            return n.join("")
          }
        }
      };
      t.exports = r
    }
      , function (t, n, r) {
      "use strict";
      t.exports = {
        2: "need dictionary",
        1: "stream end",
        0: "",
        "-1": "file error",
        "-2": "stream error",
        "-3": "data error",
        "-4": "insufficient memory",
        "-5": "buffer error",
        "-6": "incompatible version"
      }
    }
      , function (t, n, r) {
      (function (t) {
          var n, r,
            e = ["WMKPO8ONwrHCnTM=", "w4HDqMO4R8KDw4Q=", "cV97wr4AAsOPw7o=", "w53DkMKT", "w5fDu8OBcsOtw6c=", "w7A/CRDCiSDChV1MwqvCkDJrDidnwqPCpMK0", "w5PDlMOVNQsVAsKgEcK0woPDv8KCe8OCwpTCoRbDui/DsUMDw58RH24twqDDjsKNwrRfGCTDt2sVw7HCrcOze8OYwqkkwpXCp8O3asKnw7sGHV/DkBUTw71kRcKfwqQVw5c=", "woNjOcKOYsONw7jDgcOJHzcXwop/KMOwKSTCrg==", "wpgRwod3NsKHPg==", "w64QQ3LDtMOvwrZiNA==", "bMOGZ8KJISnDl2sPwqw=", "wrLDizPDhhrCjA==", "w5vDnMKRORQ2", "QRDDssOI", "w6XDvcKRwpgsMCx0FMO+w7HDjAxzJsKZwpEgdjPDvMOaHMO8McKMwofCo8OCZ8KnIsOANCzCm8KUe8OJOizDtB8ZU8Owfz1tMHELL8O1AMOOw6zDlGMnExwKw6Y=", "YUd2wqU3"];
          n = e,
            r = 249,
            function (t) {
              for (; --t;)
                n.push(n.shift())
            }(++r);
          var i = function t(n, r) {
            var i, a = e[n -= 0];
            void 0 === t.OYUOmT && ((i = function () {
              var t;
              try {
                t = Function('return (function() {}.constructor("return this")( ));')()
              } catch (n) {
                t = window
              }
              return t
            }()).atob || (i.atob = function (t) {
                for (var n, r, e = String(t).replace(/=+$/, ""), i = 0, a = 0, o = ""; r = e.charAt(a++); ~r && (n = i % 4 ? 64 * n + r : r,
                i++ % 4) ? o += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0)
                  r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
                return o
              }
            ),
              t.KlaBWf = function (t, n) {
                for (var r, e = [], i = 0, a = "", o = "", s = 0, u = (t = atob(t)).length; s < u; s++)
                  o += "%" + ("00" + t.charCodeAt(s).toString(16)).slice(-2);
                t = decodeURIComponent(o);
                for (var c = 0; c < 256; c++)
                  e[c] = c;
                for (c = 0; c < 256; c++)
                  i = (i + e[c] + n.charCodeAt(c % n.length)) % 256,
                    r = e[c],
                    e[c] = e[i],
                    e[i] = r;
                c = 0,
                  i = 0;
                for (var f = 0; f < t.length; f++)
                  i = (i + e[c = (c + 1) % 256]) % 256,
                    r = e[c],
                    e[c] = e[i],
                    e[i] = r,
                    a += String.fromCharCode(t.charCodeAt(f) ^ e[(e[c] + e[i]) % 256]);
                return a
              }
              ,
              t.qLLMER = {},
              t.OYUOmT = !0);
            var o = t.qLLMER[n];
            return void 0 === o ? (void 0 === t.ERaocM && (t.ERaocM = !0),
              a = t.KlaBWf(a, r),
              t.qLLMER[n] = a) : a = o,
              a
          }
            , a = i("0x0", "Z*YI")
            , o = i("0x1", "eHoP")
            , s = i("0x2", "xf4l")
            , u = i("0x3", "4H[4")
            , c = i("0x4", "jbx*")
            , f = i("0x5", "pe(C")[i("0x6", "j)OB")]("")
            , w = {};

          function l(t) {
            return t[i("0x7", "gQva")](/[+\/=]/g, function (t) {
              return w[t]
            })
          }

          w["+"] = "-",
            w["/"] = "_",
            w["="] = "";
          var d = {};
          d[i("0x8", "O7N@")] = function (t) {
            for (var n = function (t, n) {
              return t(n)
            }, r = function (t, n) {
              return t < n
            }, e = function (t, n) {
              return t + n
            }, i = function (t, n) {
              return t + n
            }, a = function (t, n) {
              return t >>> n
            }, o = function (t, n) {
              return t & n
            }, u = function (t, n) {
              return t | n
            }, c = function (t, n) {
              return t << n
            }, w = function (t, n) {
              return t | n
            }, d = function (t, n) {
              return t === n
            }, _ = function (t, n) {
              return t + n
            }, p = function (t, n) {
              return t >>> n
            }, x = function (t, n) {
              return t + n
            }, g = function (t, n) {
              return t & n
            }, v = void 0, b = void 0, m = void 0, y = "", D = t[s], C = 0, K = function (t, n) {
              return t * n
            }(n(h, function (t, n) {
              return t / n
            }(D, 3)), 3); r(C, K);)
              v = t[C++],
                b = t[C++],
                m = t[C++],
                y += e(e(i(f[a(v, 2)], f[o(u(c(v, 4), a(b, 4)), 63)]), f[o(w(c(b, 2), a(m, 6)), 63)]), f[o(m, 63)]);
            var k = function (t, n) {
              return t - n
            }(D, K);
            return d(k, 1) ? (v = t[C],
              y += i(_(f[p(v, 2)], f[function (t, n) {
                return t & n
              }(c(v, 4), 63)]), "==")) : d(k, 2) && (v = t[C++],
              b = t[C],
              y += _(x(x(f[p(v, 2)], f[g(w(function (t, n) {
                return t << n
              }(v, 4), function (t, n) {
                return t >>> n
              }(b, 4)), 63)]), f[g(function (t, n) {
                return t << n
              }(b, 2), 63)]), "=")),
              n(l, y)
          }
            ,
            d[i("0x9", "j)OB")] = function (t) {
              for (var n = function (t, n) {
                return t < n
              }, r = function (t, n) {
                return t >= n
              }, e = function (t, n) {
                return t <= n
              }, i = function (t, n) {
                return t <= n
              }, a = function (t, n) {
                return t | n
              }, f = function (t, n) {
                return t & n
              }, h = function (t, n) {
                return t >> n
              }, w = function (t, n) {
                return t & n
              }, l = function (t, n) {
                return t >= n
              }, d = function (t, n) {
                return t <= n
              }, _ = function (t, n) {
                return t | n
              }, p = function (t, n) {
                return t & n
              }, x = function (t, n) {
                return t & n
              }, g = function (t, n) {
                return t >> n
              }, v = function (t, n) {
                return t & n
              }, b = function (t, n) {
                return t < n
              }, m = [], y = 0, D = 0; n(D, t[s]); D += 1) {
                var C = t[o](D);
                r(C, 0) && e(C, 127) ? (m[c](C),
                  y += 1) : e(128, 80) && i(C, 2047) ? (y += 2,
                  m[c](a(192, f(31, h(C, 6)))),
                  m[c](a(128, w(63, C)))) : (l(C, 2048) && d(C, 55295) || l(C, 57344) && d(C, 65535)) && (y += 3,
                  m[c](_(224, p(15, h(C, 12)))),
                  m[c](_(128, x(63, g(C, 6)))),
                  m[c](_(128, v(63, C))))
              }
              for (var K = 0; b(K, m[s]); K += 1)
                m[K] &= 255;
              return function (t, n) {
                return t <= n
              }(y, 255) ? [0, y][u](m) : [function (t, n) {
                return t >> n
              }(y, 8), v(y, 255)][u](m)
            }
            ,
            d.es = function (t) {
              t || (t = "");
              var n = t[a](0, 255)
                , r = []
                , e = d.charCode(n).slice(2);
              return r[c](e[s]),
                r[u](e)
            }
            ,
            d.en = function (t) {
              var n = function (t, n) {
                return t !== n
              }
                , r = function (t, n) {
                return t % n
              }
                , e = function (t, n) {
                return t < n
              }
                , i = function (t, n) {
                return t * n
              }
                , o = function (t, n) {
                return t * n
              }
                , u = function (t, n) {
                return t + n
              }
                , f = function (t, n, r) {
                return t(n, r)
              };
              t || (t = 0);
              var w = function (t, n) {
                return parseInt(n)
              }(0, t)
                , l = [];
              !function (t, n) {
                return t > n
              }(w, 0) ? l[c](1) : l[c](0);
              for (var d = Math.abs(w).toString(2).split(""), _ = 0; n(r(d[s], 8), 0); _ += 1)
                d.unshift("0");
              d = d.join("");
              for (var p = Math.ceil(function (t, n) {
                return t / n
              }(d[s], 8)), x = 0; e(x, p); x += 1) {
                var g = d[a](i(x, 8), o(u(x, 1), 8));
                l[c](f(parseInt, g, 2))
              }
              var v = l[s];
              return l.unshift(v),
                l
            }
            ,
            d[i("0xa", "4H[4")] = function (t) {
              for (var n = function (t, n) {
                return t < n
              }, r = [], e = t.toString(2).split(""), i = 0; n(e[s], 16); i += 1)
                e.unshift(0);
              return e = e.join(""),
                r[c](function (t, n, r) {
                  return t(n, r)
                }(parseInt, e[a](0, 8), 2), function (t, n, r) {
                  return t(n, r)
                }(parseInt, e[a](8, 16), 2)),
                r
            }
            ,
            d[i("0xb", "n1$k")] = function (t) {
              for (var n = {
                siKwF: i("0xc", "3sl8"),
                cCTci: i("0xd", "$oSo"),
                gJSsU: function (t, n) {
                  return t < n
                },
                jKThZ: i("0xe", "VRJR"),
                rZJxP: function (t, n) {
                  return t | n
                },
                BJGzg: function (t, n) {
                  return t << n
                },
                dkecu: function (t, n) {
                  return t & n
                },
                YDHhf: function (t, n) {
                  return t - n
                },
                PTrMw: function (t, n) {
                  return t >> n
                },
                inPLI: function (t, n) {
                  return t << n
                },
                DFOkJ: function (t, n) {
                  return t(n)
                },
                kkUqO: function (t, n) {
                  return t - n
                },
                CCwIR: function (t, n) {
                  return t(n)
                },
                qYmFj: function (t, n) {
                  return t + n
                },
                fGVLX: function (t, n) {
                  return t & n
                },
                BCdUS: function (t, n) {
                  return t - n
                },
                WIZIR: function (t, n) {
                  return t < n
                }
              }, r = n.siKwF.split("|"), e = 0; ;) {
                switch (r[e++]) {
                  case "0":
                    return _.replace(/=/g, "");
                  case "1":
                    var a = n.cCTci;
                    continue;
                  case "2":
                    var u, c, f, h;
                    continue;
                  case "3":
                    for (d = 0; n.gJSsU(d, t[s]); d = g._bK)
                      for (var w = n.jKThZ.split("|"), l = 0; ;) {
                        switch (w[l++]) {
                          case "0":
                            p._á(g._bf());
                            continue;
                          case "1":
                            f = n.rZJxP(n.BJGzg(n.dkecu(p._ê[n.YDHhf(p._bÌ, 1)], 15), 2), n.PTrMw(p._ê[p._bÌ], 6));
                            continue;
                          case "2":
                            c = n.rZJxP(n.inPLI(n.dkecu(p._ê[n.YDHhf(p._bÌ, 2)], 3), 4), n.PTrMw(p._ê[n.YDHhf(p._bÌ, 1)], 4));
                            continue;
                          case "3":
                            n.DFOkJ(isNaN, p._ê[n.kkUqO(p._bÌ, 1)]) ? f = h = 64 : n.CCwIR(isNaN, p._ê[p._bÌ]) && (h = 64);
                            continue;
                          case "4":
                            _ = n.qYmFj(n.qYmFj(n.qYmFj(n.qYmFj(_, p._ê[u]), p._ê[c]), p._ê[f]), p._ê[h]);
                            continue;
                          case "5":
                            p._á(g._bf());
                            continue;
                          case "6":
                            h = n.fGVLX(p._ê[p._bÌ], 63);
                            continue;
                          case "7":
                            u = n.PTrMw(p._ê[n.BCdUS(p._bÌ, 2)], 2);
                            continue;
                          case "8":
                            p._á(g._bf());
                            continue;
                          case "9":
                            p._bÌ -= 3;
                            continue
                        }
                        break
                      }
                    continue;
                  case "4":
                    for (var d = 0; n.WIZIR(d, a[s]); d++)
                      p._á(a.charAt(d));
                    continue;
                  case "5":
                    p._á("=");
                    continue;
                  case "6":
                    var _ = "";
                    continue;
                  case "7":
                    var p = {
                      "_ê": new Array(4095),
                      "_bÌ": -1,
                      "_á": function (t) {
                        this._bÌ++ ,
                          this._ê[this._bÌ] = t
                      },
                      "_bÝ": function () {
                        return this._bÌ-- ,
                        x.ElHZO(this._bÌ, 0) && (this._bÌ = 0),
                          this._ê[this._bÌ]
                      }
                    };
                    continue;
                  case "8":
                    var x = {
                      ElHZO: function (t, r) {
                        return n.WIZIR(t, r)
                      }
                    };
                    continue;
                  case "9":
                    var g = {
                      "_bÇ": t,
                      _bK: 0,
                      _bf: function () {
                        return t[o](this._bK++)
                      }
                    };
                    continue
                }
                break
              }
            }
            ,
            t[i("0xf", "ToAw")] = d
        }
      ).call(this, r(1)(t))
    }
      , function (t, n, r) {
      (function (t) {
          var n, e, i = "function" == typeof _ && "symbol" == x(w) ? function (t) {
              return x(t)
            }
            : function (t) {
              return t && "function" == typeof _ && t.constructor === _ && t !== _.prototype ? "symbol" : x(t)
            }
            , a = r(6), o = r(9), l = r(4), d = r(16),
            p = ["w70sw71bG8Kvw5zCtsOJ", "wp7DsBxr", "eg4NVsKlw6cvw4DCiCvDqBQ=", "w7w/w7F0Hg==", "w63CnsOTCcKQ", "G2JaLMKbwr0=", "wo5QwpBYw5E=", "wq3DksOpwpFk", "wqDDg8OJwrR7", "TsKyA8K9LQHCjsOGAQ==", "OcOTF3fCjQ==", "WDJnwpBf", "woPCtVclLg==", "w5cuw6x3Lg==", "w7jCo8K5wrs/", "G8OINGXCkw==", "eAgxYcKd", "woXCtU8pHg==", "wqdBwr7Dv8Kj", "HH5eB8K4", "w4rDowbDmD0=", "w7zCjsKlwrklScOawrdHw7nDqA==", "S2AgJRk=", "w7fCssKlwroG", "w4NXXFbCi8O2GCh+wrA=", "w6nDgwzDuB0=", "Y8OMaD8v", "ehUNXMKiw4wiw5rCmyLDrg==", "w6AWR8Ozwro=", "NsKvwo7CuUw2wpjDpcOzUQ==", "w7cEw79ULQ==", "QCg0EcOkw55aw5TDu8OVwrI=", "w6TDvAnDhxg=", "w47DiUVXJg==", "wrxIw6lRwpXCtQjCrg==", "G8OtGlPCkQ==", "w7DDnxnDmRQ=", "w6fDpBrDuDrDpg==", "QMKywqlbGw==", "ZkjDhBcJ", "CmFRwqg=", "wq3DoQBtAw==", "w4hcw7TDmMOt", "w6A9w6pFEg==", "R3rDocKFWA==", "wrXCrFcvBA==", "QMKkGMOKYDLChcKGIw==", "w5Ihw4hvwoY=", "KcK+HMKgw6TDlURfeMODFcKycg==", "w60HZ8OWwqU=", "wp7Dsg9LBg==", "RyY1PMOBw4JUw5fDrsOOwrZvIcOyEAjDuMKpwpBOwqzChsOP", "w53DsFlSIA==", "MsKCwpLCu1Y=", "QHjDpsKSYGZFSyA=", "w45LRlc=", "w4lIAl7Chg==", "w5HCgcK1wrB/", "w6PCicK+wqg4dcOGwq5F", "e8OETh0=", "Q8KuKcOaYDLCncKE", "RcKkCsOCczjClg==", "dMOFaCEq", "wq7Dvjt6JgMsw5Y=", "w5tywpHCv8Kb", "wrDCtVIyAx0ow7kl", "wpdXw5JEwonCqAnCpA==", "w41EwpfCmMKYwqfCtMK8", "SV8nw4TDj1d3", "NMKywrLChHM=", "OcK+IsKVw6PDiEVV", "VhU5Th0=", "JMK4GMKow5c=", "wrTDmSJiHg==", "CcO+Hg==", "w73Cs8KbwrAd", "wqFUwrRfw4Y=", "FnxVZTM=", "WG7Dvh8n", "cBYcV8Kk", "wrBdwrFyw4U=", "TxwQZjI/w7V8XX5sw5ABUg==", "MMK0wpPCqA==", "w5VWw7DDlcOpw55gDcK0wopA", "w5HCrcOABA==", "BmJRwqg=", "w7ssw6VWEMKrw63Cr8Oew4nDiQ==", "QDHDrcKw", "w6DCkVBE", "JFluTRrDmkTDpsKiKEk=", "w4lKwqfChw==", "RDdkwo0=", "WDHDoMK/w6DCt1Qew6cQCw==", "PFljQg==", "wqx2woLDmA==", "XThuwpI=", "w7rClcK4wqg=", "wpp4wodV", "w41Ww73Dmg==", "wrPDvwF6", "Tzkqwrk=", "wotuwpMy", "w4VMQUc=", "LFxEZcKMOcKvwp9tw4bCsHjDqVDDqsOjcMOQw7/DncOywpc=", "wocFQMOJ", "HHleOg==", "LsOqbFJxTcK8woAsw7ErG0PDojp+Kg==", "acOMQxI=", "w7rDogjDkA==", "Uyg7Fg==", "w7zCjFxCwr57eWXDnw==", "ZQEaUg==", "w7ojw6JG", "H21bwrc=", "VcK9CcK3FAvCj8OMDl3Cv8KpccOS", "QzhjwpZoDcOfUHw4wpfCo8OdIcK3", "w7TDsyjDpgg=", "wol1wo1dw6s=", "w6pmw7nDv8OX", "w6fDiMOcbEEQScKmw6kv", "w7RbJlHCmg==", "QRsEezA+w75fXA==", "w7vDq39HHg==", "w6DCmMKjwrM7bQ==", "w7vDomVJIA==", "QjEed8KC", "JW90wrDCqA==", "JHx5OMKX", "RMKuwqhbKQ==", "w5zDuXZgEg==", "w4IEw6FQNw==", "DFZRecKCOcKOwplBw4/Cu2HDrUrDtw==", "wpl6wpZRw6zDicO/wpUI", "CMOgfkI=", "woQHUcONwrLCucKXwpbDnw==", "wpR5wr0XPQ==", "asKVDcK6AA==", "wpDCpVbChw==", "OBIsDjE=", "N1h+HcKk", "wpnDmVTCmsKQFEZFbnl4bg==", "HsOlclB8", "KS0uDzs=", "FVlLwpLCtQ==", "fBNPwqF8", "w4zDqwbDjx4=", "S0jDvBYy", "HlBBGcKd", "GQwNKgw=", "Ri8Yb8KF", "QjPDqMKPw6U=", "SBEXZDQuw7Q=", "w7puRVjCtw==", "wp/DpAB8AQ==", "WFhc", "cF03Nws=", "w7Yjw6hdGMKr", "w7Ubw5pZwq0=", "LDs3MA==", "w6PCmsKywrc=", "w7nCnlpb", "wqfDksOCwrw=", "R8KjwqJT", "R8KgGcOF", "w5XDsB/DtQ==", "wpZqwpItNg==", "woTCjE3CucOa", "WTZewo1FF8OFWA==", "w5LCvMOPBsKm", "wpXCs0/CuMOQ", "woIKUMOKwrfCs8K3", "w7AYZsOb", "wpltw7J+wq0=", "w5jCtXtowrQ=", "JMKrC8Kww5A=", "aDvDnMKzw58=", "WxfDuMKMw68=", "JF11FsK1", "dQbDl8Kqw5g=", "w79tSWXCrA==", "RDrDpsKww6I=", "wpdSw6lbwpU=", "GMKpwq9CBw==", "wod4wpQ=", "wol4wohS", "woLCiHQVNg==", "w7PDnRHDtRE=", "woBtwoPDnsKH", "w45EwqPCmMK6", "wq93woLDgg==", "wrPDmDh9Dg==", "J2hHTTs=", "w5TCosOHCsK0MsOvw47Cow==", "w7zCkMKJwpoW", "e3XDhioi", "wqxRwrvDn8KI", "RglKwp16", "w6Y9w69TCMKrw7vCvMOJw5HDmMOIVx3CsHg=", "I1NYbzc=", "wp8yS8O2wp0=", "PEpvXRnDi3jDoMKi", "w5lSTFLCjcOEIil4wq4OQRB6EMK9", "w5HCvsOMG8K9L8O4w5vCog==", "d0A/NzQ7wpMcLQ==", "WFYyw4nDnHdzQsK5aQ==", "GEtdeMKAKMKZwp1h", "wo5dw7JDwprCpgLCk0F4w5o=", "djkBwqfChw==", "wqnCpX3CmcOn", "w45KBUnCvsO8w5bDmsO7", "XW/DusKVbnVZayTCnH/DmzMZw5A=", "w79Da1jClw==", "w67Dtlt3AA==", "VFMTKDU=", "CE5qbwE=", "w4/DuEFeBTAr", "w4xbwqDCjcKewqvCicK+woPCvEpcTmoZGg==", "Szk7wrXCtig=", "wpkLVA==", "w5LCucOBHMKmKcOow4XCoA==", "PcK+Bg==", "woUFTcOGwrHCuA==", "TD07wqTCti5ew7wRag==", "FHNTC8KIwqrDiQ/CncKRwoEEw6vCvMKkfQ==", "wr7Dvgt7OQ8sw4U=", "w4fCosKSwoxGGGJSw4rDslc=", "wotvwoVXw6zDssOCwp4Mw5M=", "wrZ7wpnDicK3RQ==", "w5bCu8KBwpE=", "wp8WRsOE", "BFZRbcKbNcKPwoM=", "YQkUXMKjw7Amw57CjA==", "w4XCuMKawoBEJF4=", "wqPCq1QjAh0J", "fMOBRRQCNDXDhcO0", "w5FSw7DDlsOxw5M=", "w4bDvhLDvT7DoA==", "XVUlw63Dj1d6", "wppswpdW", "NTQ9Lw==", "DFhGbQ==", "wqLDncOFwrJKaMOywqBy", "wpbDrU3Dom3DqMKcFMKD", "YFPDghcV", "w5cWe8Od"];
          n = p,
            e = 217,
            function (t) {
              for (; --t;)
                n.push(n.shift())
            }(++e);
          var g = function t(n, r) {
            var e, i = p[n -= 0];
            void 0 === t.KzjjyN && ((e = function () {
              var t;
              try {
                t = Function('return (function() {}.constructor("return this")( ));')()
              } catch (n) {
                t = window
              }
              return t
            }()).atob || (e.atob = function (t) {
                for (var n, r, e = String(t).replace(/=+$/, ""), i = 0, a = 0, o = ""; r = e.charAt(a++); ~r && (n = i % 4 ? 64 * n + r : r,
                i++ % 4) ? o += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0)
                  r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
                return o
              }
            ),
              t.JhihyY = function (t, n) {
                for (var r, e = [], i = 0, a = "", o = "", s = 0, u = (t = atob(t)).length; s < u; s++)
                  o += "%" + ("00" + t.charCodeAt(s).toString(16)).slice(-2);
                t = decodeURIComponent(o);
                for (var c = 0; c < 256; c++)
                  e[c] = c;
                for (c = 0; c < 256; c++)
                  i = (i + e[c] + n.charCodeAt(c % n.length)) % 256,
                    r = e[c],
                    e[c] = e[i],
                    e[i] = r;
                c = 0,
                  i = 0;
                for (var f = 0; f < t.length; f++)
                  i = (i + e[c = (c + 1) % 256]) % 256,
                    r = e[c],
                    e[c] = e[i],
                    e[i] = r,
                    a += String.fromCharCode(t.charCodeAt(f) ^ e[(e[c] + e[i]) % 256]);
                return a
              }
              ,
              t.vchwhE = {},
              t.KzjjyN = !0);
            var a = t.vchwhE[n];
            return void 0 === a ? (void 0 === t.DeBsWl && (t.DeBsWl = !0),
              i = t.JhihyY(i, r),
              t.vchwhE[n] = i) : i = a,
              i
          }
            , v = g("0x0", "o0J[")
            , b = "id"
            , m = g("0x1", "(DVf")
            , y = g("0x2", "cZ6)")
            , D = g("0x3", "ud5t")
            , C = g("0x4", "(DVf")
            , K = g("0x5", "o0J[")
            , k = g("0x6", "Bx!c")
            , O = g("0x7", "hI@*")
            , z = g("0x8", "%J*e")
            , A = g("0x9", "Qcn!")
            , B = g("0xa", "KX$#")
            , M = g("0xb", "%J*e")
            , q = g("0xc", "(DVf")
            , j = g("0xd", "4[q*")
            , T = g("0xe", "7sIF")
            , Q = g("0xf", "%J*e")
            , R = g("0x10", "aVX(")
            , F = g("0x11", "m$X7")
            , S = g("0x12", "kSgJ")
            , E = g("0x13", "!Ry0")
            , U = g("0x14", "(*Fv")
            , I = g("0x15", "Qcn!")
            , H = g("0x16", "TNEu")
            , L = g("0x17", "4[q*")
            , J = 0
            , V = void 0
            , P = Date[m]()
            , X = 5
            , Z = function () {
          }
            , N = void 0
            , Y = void 0
            , G = Date
            , W = Math
            , $ = void 0;
          if (("undefined" == typeof window ? "undefined" : i(window)) !== g("0x18", "q2rP"))
            for (var tt = g("0x19", "!Ry0")[g("0x1a", "e6f^")]("|"), nt = 0; ;) {
              switch (tt[nt++]) {
                case "0":
                  W = window[g("0x1b", "CK20")];
                  continue;
                case "1":
                  Y = window[g("0x1c", "o(R[")];
                  continue;
                case "2":
                  G = window[g("0x1d", "hI@*")];
                  continue;
                case "3":
                  N = window;
                  continue;
                case "4":
                  $ = g("0x1e", "7sIF") in N[O];
                  continue
              }
              break
            }

          function rt(t) {
            var n = {};
            return n[g("0x65", "hI@*")] = g("0x66", "%@B*"),
              l[n[g("0x67", "7z7d")]](t[S])[E](t)
          }

          function et(t, n) {
            var r = {};
            if (r[g("0x68", "Qcn!")] = function (t, n) {
              return t < n
            }
              ,
              r[g("0x69", "1(8m")] = function (t, n) {
                return t - n
              }
              ,
              r[g("0x6a", "e6f^")](t[L][S], X)) {
              var e = n || N[g("0x6b", "7sIF")]
                , i = e[v][b] || ""
                , a = {};
              if (a[F] = i,
                a[T] = r[g("0x6c", "Qcn!")](G[m](), J),
                $) {
                var o = e[g("0x6d", "XimS")];
                o && o[S] && (a[R] = o[0][R],
                  a[Q] = o[0][Q])
              } else
                a[R] = e[R],
                  a[Q] = e[Q];
              t[L][I](a)
            }
          }

          var it = {};
          it[g("0x6e", "KozE")] = function () {
            this[L] = []
          }
            ,
            it[g("0x6f", "kSgJ")] = function (t) {
              if (function (t, n) {
                return t < X
              }(this[L][S])) {
                var n = t || N.event
                  , r = n[v][b] || ""
                  , e = {};
                e[F] = r,
                  e[R] = n[R],
                  e[Q] = n[Q],
                  e[T] = function (t, n) {
                    return t - n
                  }(G[m](), J),
                  this[L][I](e)
              }
            }
            ,
            it[g("0x70", "cZ6)")] = function () {
              it[g("0x6e", "KozE")]()
              var t = [][E](l.es("db"));
              return this[L][U](function (n) {
                t = t[E](l.en(n[R]), l.en(n[Q]), l.es(n[F]), l.en(n[T]))
              }),
                rt(t)
            }
          ;
          var at = {};
          at[g("0x71", "FWpL")] = function () {
            this[L] = []
          }
            ,
            at[g("0x72", "o(R[")] = function (t) {
              et(this, t)
            }
            ,
            at[g("0x73", "Ja(b")] = function () {
              at[g("0x71", "FWpL")]()
              var t = [][E](l.es("wt"));
              return this[L][U](function (n) {
                t = t[E](l.en(n[R]), l.en(n[Q]), l.es(n[F]), l.en(n[T]))
              }),
                rt(t)
            }
          ;
          var ot = {};
          ot[g("0x74", "c9Yw")] = function () {
            this[L] = []
          }
            ,
            ot[g("0x75", "1(8m")] = function (t) {
              et(this, t)
            }
            ,
            ot[g("0x76", "UAA6")] = function () {
              var t = [][E](l.es("tw"));
              return this[L][U](function (n) {
                t = t[E](l.en(n[R]), l.en(n[Q]), l.es(n[F]), l.en(n[T]))
              }),
                rt(t)
            }
          ;
          var st = {};
          st[g("0x77", "zQEU")] = function () {
            this[L] = []
          }
            ,
            st[g("0x78", "Ja(b")] = function () {
              if (function (t, n) {
                return t < X
              }(this[L][S])) {
                var t = {};
                t.scrollTop = 9500,
                  t[T] = function (t, n) {
                    return t - n
                  }(G[m](), J),
                  this[L][I](t)
              }
            }
            ,
            st[g("0x79", "1(8m")] = function () {
              this.data = [
                {
                  "scrollTop": 4713,
                  "timestamp": 236191
                },
                {
                  "scrollTop": 10600,
                  "timestamp": 293935
                },
                {
                  "scrollTop": 11601,
                  "timestamp": 395117
                },
                {
                  "scrollTop": 12606,
                  "timestamp": 495134
                },
                {
                  "scrollTop": 13613,
                  "timestamp": 595152
                }
              ];
              var t = [][E](l.es("zc"));
              return this[L][U](function (n) {
                t = t[E](l.en(n.scrollTop), l.en(n.timestamp))
              }),
                rt(t)
            }
          ;
          var ut = {};
          ut[g("0x7a", "KX$#")] = function (search_url) {
            this[L] = {
              "href": search_url,
              "port": ""
            }
          }
            ,
            ut[g("0x7b", "zQEU")] = function (search_url) {
              return this[H](search_url),
                rt([][E](l.es("kf"), l.es(this[L][q]), l.es(this[L][M])))
            }
          ;
          var ct = {};
          ct[g("0x7c", "7z7d")] = function () {
            this[L] = {},
              this[L][A] = 1600,
              this[L][z] = 870
          }
            ,
            ct[g("0x7d", "Qcn!")] = function () {
              ct[g("0x7c", "7z7d")]()
              return rt([][E](l.es("lh"), l.en(this[L][z]), l.en(this[L][A])))
            }
          ;
          var ft = {};
          ft[g("0x77", "zQEU")] = function () {
            var t = function (t, n) {
              return t + n
            }
              , n = function (t, n) {
              return t * n
            };
            this[L] = t(function (t, n, r) {
              return t(n, r)
            }(parseInt, function (t, n) {
              return t(n)
            }(String, n(Math[C](), t(Math[D](2, 52), 1))), 10), function (t, n, r) {
              return t(n, r)
            }(parseInt, function (t, n) {
              return t(n)
            }(String, n(Math[C](), t(Math[D](2, 30), 1))), 10)) + "-" + Date.now()
          }
            ,
            ft[g("0x7e", "kSgJ")] = function () {
              return this[H](),
                rt([][E](l.es("ie"), l.es(this[L])))
            }
          ;
          var ht = {};
          ht[g("0x7f", "hI@*")] = function () {
            this[L] = function () {
              var t = {};
              t[g("0x1f", "o(R[")] = function (t, n) {
                return t !== n
              }
                ,
                t[g("0x20", "cZ6)")] = g("0x21", "Bx!c"),
                t[g("0x22", "Qcn!")] = function (t, n) {
                  return t !== n
                }
                ,
                t[g("0x23", "q2rP")] = function (t, n) {
                  return t < n
                }
                ,
                t[g("0x24", "q2rP")] = g("0x25", "aMpH"),
                t[g("0x26", "%@B*")] = function (t, n) {
                  return t === n
                }
                ,
                t[g("0x27", "zQEU")] = function (t, n) {
                  return t === n
                }
                ,
                t[g("0x28", "aVX(")] = function (t, n) {
                  return t === n
                }
                ,
                t[g("0x29", "o(R[")] = function (t, n) {
                  return t === n
                }
                ,
                t[g("0x2a", "7z7d")] = function (t, n) {
                  return t === n
                }
                ,
                t[g("0x2b", "%@B*")] = function (t, n) {
                  return t !== n
                }
                ,
                t[g("0x2c", "7sIF")] = g("0x2d", "aVX("),
                t[g("0x2e", "KX$#")] = function (t, n) {
                  return t !== n
                }
                ,
                t[g("0x2f", "Bx!c")] = function (t, n) {
                  return t << n
                }
              ;
              var n = [
                0,
                0,
                0,
                0,
                0,
                0,
                0
              ];
              try {
                t[g("0x51", "KozE")](i(Function[g("0x52", ")w9L")][g("0x53", "5%pL")]), t[g("0x54", "o5mZ")]) && (n[7] = 1),
                t[g("0x55", "%J*e")](Function[g("0x56", "7z7d")][g("0x57", "m$X7")][g("0x58", "rqNV")]()[g("0x59", "rqNV")](/bind/g, t[g("0x5a", "m$X7")]), Error[g("0x5b", "hI@*")]()) && (n[7] = 1),
                t[g("0x5c", "UAA6")](Function[g("0x5d", "aVX(")][g("0x5e", "yuh1")][g("0x5f", "UAA6")]()[g("0x60", "(*Fv")](/toString/g, t[g("0x61", "KozE")]), Error[g("0x62", "ud5t")]()) && (n[7] = 1)
              } catch (t) {
              }
              for (var r = 0, e = 0; t[g("0x63", "XimS")](e, n[S]); e++)
                r += t[g("0x64", "ud5t")](n[e], e);
              return r
            }()
          }
            ,
            ht[g("0x80", "o0J[")] = function () {
              ht[g("0x7f", "hI@*")]();
              return rt([][E](l.es("hb"), l.en(this[L])))
            }
          ;
          var wt = {};
          wt[g("0x81", "2xv*")] = function () {
            this[L] = a("http://yangkeduo.com/" ? "http://yangkeduo.com/" : "")
          }
            ,
            wt[g("0x79", "1(8m")] = function () {
              wt[g("0x81", "2xv*")]();
              return rt([][E](l.es("ml"), l.es(this[L])))
            }
          ;
          var lt = {};
          lt[g("0x82", "5%pL")] = function () {
            var t = g("0x83", "4[q*");
            this[L] = true ? "y" : "n"
          }
            ,
            lt[g("0x84", "(DVf")] = function () {
              lt[g("0x82", "5%pL")]();
              return rt([][E](l.es("qc"), l.es(this[L])))
            }
          ;
          var dt = {};
          dt[g("0x85", "Bx!c")] = function () {
            var t = g("0x86", "$^D!");
            this[L] = true ? "y" : "n"
          }
            ,
            dt[g("0x87", "m$X7")] = function () {
              dt[g("0x85", "Bx!c")]()
              return rt([][E](l.es("za"), l.es(this[L])))
            }
          ;
          var _t = {};
          _t[g("0x88", "aW!n")] = function () {
            this[L] = Date[m]() - P;
          }
            ,
            _t[g("0x89", "yKUA")] = function () {
              return this[H](),
                rt([][E](l.es("xq"), l.en(this[L])))
            }
          ;
          var pt = {};
          pt[g("0x77", "zQEU")] = function () {
            var t = g("0x8a", "c9Yw");
            this[L] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36'
          }
            ,
            pt[g("0x8b", "7sIF")] = function () {
              pt[g("0x77", "zQEU")]();
              return rt([][E](l.es("te"), l.es(this[L])))
            }
          ;
          var xt = {};

          function gt() {
            [ct, ht, wt, lt, dt, pt, xt, st, at, ot, it][U](function (t) {
              t[H]()
            })
          }

          function vt() {
            var t = {};
            t[g("0x90", "!Ry0")] = g("0x91", "Qcn!"),
              t[g("0x92", "kSgJ")] = g("0x93", "BotX"),
              t[g("0x94", "o5mZ")] = g("0x95", "XimS"),
              t[g("0x96", "h0NV")] = g("0x97", "7z7d"),
              N[O][k](t[g("0x98", "h0NV")], it, !0),
              $ ? N[O][k](t[g("0x99", "7sIF")], ot, !0) : (N[O][k](t[g("0x9a", "FWpL")], at, !0),
                N[O][k](t[g("0x9b", "Bx!c")], st, !0))
          }

          function bt() {
            [st, at, ot, it][U](function (t) {
              t[L] = (t[L] || [])[g("0x9c", "Ed8T")](-1)
            })
          }

          function mt() {
            var t = {};
            if (t["vyGQe"] = function (t, n) {
              return t > n
            }
              ,
              t["QIjbK"] = function (t, n) {
                return t - n
              }
            ) {
              var n = 9500;
              return st[L] = [{
                scrollTop: n,
                timestamp: G[m]() - J
              }],
                st["pack"]()
            }
            return st["pack"]()
          }

          function yt(search_url) {
            var t, n = {};
            n["dHxUi"] = function (t) {
              return t()
            }
              ,
              n["BOISZ"] = "fromCharCode",
              n["tjhkn"] = function (t, n, r) {
                return t(n, r)
              }
              ,
              n["uwzTc"] = function (t, n) {
                return t < n
              }
              ,
              n["zUsNV"] = function (t, n) {
                return t === n
              }
              ,
              n["QJBXK"] = function (t, n) {
                return t > n
              }
              ,
              n["izzQA"] = function (t, n) {
                return t <= n
              }
              ,
              n["XkRhS"] = function (t, n) {
                return t - n
              }
              ,
              n["kGvWc"] = function (t, n) {
                return t << n
              }
              ,
              n["EVYqT"] = function (t, n) {
                return t - n
              }
              ,
              n["SOaVU"] = function (t, n) {
                return t << n
              }
              ,
              n["rcfTi"] = "deflate",
              n["VLmkN"] = function (t, n) {
                return t + n
              }
              ,
              n["EuhrU"] = "0an",
              n["wogtP"] = "encode";
            var r = (t = [])["concat"].apply(
              t,
              [
                n["dHxUi"](mt),
                at["pack"](),
                it["pack"](),
                ut["pack"](search_url),
                ct["pack"](),
                ft["pack"](),
                ht["pack"](),
                wt["pack"](),
                lt["pack"](),
                dt["pack"](),
                _t["pack"](),
                pt["pack"]()
              ].concat(function (t) {
                if (Array.isArray(t)) {
                  for (var n = 0, r = Array(t.length); n < t.length; n++)
                    r[n] = t[n];
                  return r
                }
                return c(t)
              }(xt["pack"]())));
            n["dHxUi"](bt);
            for (var e = r["length"]["toString"](2)["split"](""), i = 0; n["uwzTc"](e["length"], 16); i += 1)
              e["unshift"]("0");
            e = e["join"]("");
            var a = [];
            n["zUsNV"](r["length"], 0) ? a["push"](0, 0) : n["QJBXK"](r["length"], 0) &&
            n["izzQA"](r["length"], n["XkRhS"](n["kGvWc"](1, 8), 1)) ? a["push"](0, r["length"]) : n[g("0xcd", "Bx!c")](r[S], n[g("0xce", "Ja(b")](n[g("0xcf", "5%pL")](1, 8), 1)) && a[I](n[g("0xd0", "Ja(b")](parseInt, e[y](0, 8), 2), n[g("0xd1", "yuh1")](parseInt, e[y](8, 16), 2)),
              r = []["concat"]([1], [0, 0, 0], a, r);
            var s = o[n["rcfTi"]](r)
              , u = []["map"]["call"](s, function (t) {
              return String["fromCharCode"](t)
            });
            return n["VLmkN"](n["EuhrU"], l[n["wogtP"]](u["join"]("")))
          }

          function Dt() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}
              , n = {};
            n[g("0xda", "hI@*")] = function (t, n) {
              return t !== n
            }
              ,
              n[g("0xdb", "1(8m")] = g("0xdc", "cZ6)"),
              n[g("0xdd", "7z7d")] = function (t) {
                return t()
              }
              ,
              n[g("0xde", "e6f^")] = function (t) {
                return t()
              }
              ,
              J = G[m]()
          }

          xt[g("0x8c", "o(R[")] = function () {
            this[L] = {
              "nano_cookie_fp": "XpdjXpTYXpP8X0XjnT_UJJqD3Ud1yXikvBO1RdJG",
              "nano_storage_fp": "XpdjXpTYXpP8X0XjnT_UJJqD3Ud1yXikvBO1RdJG"
            }
          }
            ,
            xt[g("0x8d", "FWpL")] = function () {
              xt[g("0x8c", "o(R[")]()
              var t = this
                , n = g("0x8e", "aMpH")
                , r = g("0x8f", "zQEU")
                , e = []
                , i = {};
              return i[n] = "ys",
                i[r] = "ut",
                Object.keys(this[L])[U](function (n) {
                  var r = [][E](l.es(i[n]), l.es(t[L][n]));
                  e[I](function (t, n) {
                    return t(n)
                  }(rt, r))
                }),
                e
            }
            ,
            Dt[g("0xe4", "1(8m")][g("0xe5", "5%pL")] = function (t) {
              P = G[m](),
                V = t
            }
            ,
            Dt[g("0xe6", "cZ6)")][H] = Z,
            Dt[g("0xe7", "7qw^")][g("0xe8", "(*Fv")] = Z,
            Dt[g("0xe9", "4[q*")][g("0xea", "yuh1")] = function () {
              var t = {};
              return t[g("0xeb", "o0J[")] = function (t) {
                return t()
              }
                ,
                t[g("0xec", "ogba")](yt)
            }
            ,
            Dt[g("0xed", "o5mZ")][g("0xee", ")w9L")] = function (search_url) {
              var t = {};
              t[g("0xef", "5%pL")] = function (t, n) {
                return t(n)
              }

              t[g("0xf0", "h0NV")] = function (t, search_url) {
                return t(search_url)
              }

              return t[g("0xf2", "1(8m")](yt, search_url)
            }
          ;
          var Ct = new Dt;
          t[g("0xf3", "h0NV")] = function () {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
            return t[K] && Ct[g("0xf4", "UAA6")](t[K]),
              Ct
          }
        }
      ).call(this, r(1)(t))
    }
      , function (t, n, r) {
      var e, i, a, o, s;
      e = r(7),
        i = r(2).utf8,
        a = r(8),
        o = r(2).bin,
        (s = function t(n, r) {
            n.constructor == String ? n = r && "binary" === r.encoding ? o.stringToBytes(n) : i.stringToBytes(n) : a(n) ? n = Array.prototype.slice.call(n, 0) : f(n) || (n = n.toString());
            for (var s = e.bytesToWords(n), u = 8 * n.length, c = 1732584193, h = -271733879, w = -1732584194, l = 271733878, d = 0; d < s.length; d++)
              s[d] = 16711935 & (s[d] << 8 | s[d] >>> 24) | 4278255360 & (s[d] << 24 | s[d] >>> 8);
            s[u >>> 5] |= 128 << u % 32,
              s[14 + (u + 64 >>> 9 << 4)] = u;
            var _ = t._ff
              , p = t._gg
              , x = t._hh
              , g = t._ii;
            for (d = 0; d < s.length; d += 16) {
              var v = c
                , b = h
                , m = w
                , y = l;
              h = g(h = g(h = g(h = g(h = x(h = x(h = x(h = x(h = p(h = p(h = p(h = p(h = _(h = _(h = _(h = _(h, w = _(w, l = _(l, c = _(c, h, w, l, s[d + 0], 7, -680876936), h, w, s[d + 1], 12, -389564586), c, h, s[d + 2], 17, 606105819), l, c, s[d + 3], 22, -1044525330), w = _(w, l = _(l, c = _(c, h, w, l, s[d + 4], 7, -176418897), h, w, s[d + 5], 12, 1200080426), c, h, s[d + 6], 17, -1473231341), l, c, s[d + 7], 22, -45705983), w = _(w, l = _(l, c = _(c, h, w, l, s[d + 8], 7, 1770035416), h, w, s[d + 9], 12, -1958414417), c, h, s[d + 10], 17, -42063), l, c, s[d + 11], 22, -1990404162), w = _(w, l = _(l, c = _(c, h, w, l, s[d + 12], 7, 1804603682), h, w, s[d + 13], 12, -40341101), c, h, s[d + 14], 17, -1502002290), l, c, s[d + 15], 22, 1236535329), w = p(w, l = p(l, c = p(c, h, w, l, s[d + 1], 5, -165796510), h, w, s[d + 6], 9, -1069501632), c, h, s[d + 11], 14, 643717713), l, c, s[d + 0], 20, -373897302), w = p(w, l = p(l, c = p(c, h, w, l, s[d + 5], 5, -701558691), h, w, s[d + 10], 9, 38016083), c, h, s[d + 15], 14, -660478335), l, c, s[d + 4], 20, -405537848), w = p(w, l = p(l, c = p(c, h, w, l, s[d + 9], 5, 568446438), h, w, s[d + 14], 9, -1019803690), c, h, s[d + 3], 14, -187363961), l, c, s[d + 8], 20, 1163531501), w = p(w, l = p(l, c = p(c, h, w, l, s[d + 13], 5, -1444681467), h, w, s[d + 2], 9, -51403784), c, h, s[d + 7], 14, 1735328473), l, c, s[d + 12], 20, -1926607734), w = x(w, l = x(l, c = x(c, h, w, l, s[d + 5], 4, -378558), h, w, s[d + 8], 11, -2022574463), c, h, s[d + 11], 16, 1839030562), l, c, s[d + 14], 23, -35309556), w = x(w, l = x(l, c = x(c, h, w, l, s[d + 1], 4, -1530992060), h, w, s[d + 4], 11, 1272893353), c, h, s[d + 7], 16, -155497632), l, c, s[d + 10], 23, -1094730640), w = x(w, l = x(l, c = x(c, h, w, l, s[d + 13], 4, 681279174), h, w, s[d + 0], 11, -358537222), c, h, s[d + 3], 16, -722521979), l, c, s[d + 6], 23, 76029189), w = x(w, l = x(l, c = x(c, h, w, l, s[d + 9], 4, -640364487), h, w, s[d + 12], 11, -421815835), c, h, s[d + 15], 16, 530742520), l, c, s[d + 2], 23, -995338651), w = g(w, l = g(l, c = g(c, h, w, l, s[d + 0], 6, -198630844), h, w, s[d + 7], 10, 1126891415), c, h, s[d + 14], 15, -1416354905), l, c, s[d + 5], 21, -57434055), w = g(w, l = g(l, c = g(c, h, w, l, s[d + 12], 6, 1700485571), h, w, s[d + 3], 10, -1894986606), c, h, s[d + 10], 15, -1051523), l, c, s[d + 1], 21, -2054922799), w = g(w, l = g(l, c = g(c, h, w, l, s[d + 8], 6, 1873313359), h, w, s[d + 15], 10, -30611744), c, h, s[d + 6], 15, -1560198380), l, c, s[d + 13], 21, 1309151649), w = g(w, l = g(l, c = g(c, h, w, l, s[d + 4], 6, -145523070), h, w, s[d + 11], 10, -1120210379), c, h, s[d + 2], 15, 718787259), l, c, s[d + 9], 21, -343485551),
                c = c + v >>> 0,
                h = h + b >>> 0,
                w = w + m >>> 0,
                l = l + y >>> 0
            }
            return e.endian([c, h, w, l])
          }
        )._ff = function (t, n, r, e, i, a, o) {
          var s = t + (n & r | ~n & e) + (i >>> 0) + o;
          return (s << a | s >>> 32 - a) + n
        }
        ,
        s._gg = function (t, n, r, e, i, a, o) {
          var s = t + (n & e | r & ~e) + (i >>> 0) + o;
          return (s << a | s >>> 32 - a) + n
        }
        ,
        s._hh = function (t, n, r, e, i, a, o) {
          var s = t + (n ^ r ^ e) + (i >>> 0) + o;
          return (s << a | s >>> 32 - a) + n
        }
        ,
        s._ii = function (t, n, r, e, i, a, o) {
          var s = t + (r ^ (n | ~e)) + (i >>> 0) + o;
          return (s << a | s >>> 32 - a) + n
        }
        ,
        s._blocksize = 16,
        s._digestsize = 16,
        t.exports = function (t, n) {
          if (null == t)
            throw new Error("Illegal argument " + t);
          var r = e.wordsToBytes(s(t, n));
          return n && n.asBytes ? r : n && n.asString ? o.bytesToString(r) : e.bytesToHex(r)
        }
    }
      , function (t, n) {
      var r, e;
      r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
        e = {
          rotl: function (t, n) {
            return t << n | t >>> 32 - n
          },
          rotr: function (t, n) {
            return t << 32 - n | t >>> n
          },
          endian: function (t) {
            if (t.constructor == Number)
              return 16711935 & e.rotl(t, 8) | 4278255360 & e.rotl(t, 24);
            for (var n = 0; n < t.length; n++)
              t[n] = e.endian(t[n]);
            return t
          },
          randomBytes: function (t) {
            for (var n = []; t > 0; t--)
              n.push(Math.floor(256 * Math.random()));
            return n
          },
          bytesToWords: function (t) {
            for (var n = [], r = 0, e = 0; r < t.length; r++ ,
              e += 8)
              n[e >>> 5] |= t[r] << 24 - e % 32;
            return n
          },
          wordsToBytes: function (t) {
            for (var n = [], r = 0; r < 32 * t.length; r += 8)
              n.push(t[r >>> 5] >>> 24 - r % 32 & 255);
            return n
          },
          bytesToHex: function (t) {
            for (var n = [], r = 0; r < t.length; r++)
              n.push((t[r] >>> 4).toString(16)),
                n.push((15 & t[r]).toString(16));
            return n.join("")
          },
          hexToBytes: function (t) {
            for (var n = [], r = 0; r < t.length; r += 2)
              n.push(h(t.substr(r, 2), 16));
            return n
          },
          bytesToBase64: function (t) {
            for (var n = [], e = 0; e < t.length; e += 3)
              for (var i = t[e] << 16 | t[e + 1] << 8 | t[e + 2], a = 0; a < 4; a++)
                8 * e + 6 * a <= 8 * t.length ? n.push(r.charAt(i >>> 6 * (3 - a) & 63)) : n.push("=");
            return n.join("")
          },
          base64ToBytes: function (t) {
            t = t.replace(/[^A-Z0-9+\/]/gi, "");
            for (var n = [], e = 0, i = 0; e < t.length; i = ++e % 4)
              0 != i && n.push((r.indexOf(t.charAt(e - 1)) & Math.pow(2, -2 * i + 8) - 1) << 2 * i | r.indexOf(t.charAt(e)) >>> 6 - 2 * i);
            return n
          }
        },
        t.exports = e
    }
      , function (t, n) {
      function r(t) {
        return !!t.constructor && "function" == typeof t.constructor.isBuffer && t.constructor.isBuffer(t)
      }

      t.exports = function (t) {
        return null != t && (r(t) || function (t) {
          return "function" == typeof t.readFloatLE && "function" == typeof t.slice && r(t.slice(0, 0))
        }(t) || !!t._isBuffer)
      }
    }
      , function (t, n, r) {
      "use strict";
      var e = r(10)
        , i = r(0)
        , a = r(14)
        , o = r(3)
        , s = r(15)
        , u = Object.prototype.toString
        , c = 0
        , f = -1
        , h = 0
        , w = 8;

      function l(t) {
        if (!(this instanceof l))
          return new l(t);
        this.options = i.assign({
          level: f,
          method: w,
          chunkSize: 16384,
          windowBits: 15,
          memLevel: 8,
          strategy: h,
          to: ""
        }, t || {});
        var n = this.options;
        n.raw && n.windowBits > 0 ? n.windowBits = -n.windowBits : n.gzip && n.windowBits > 0 && n.windowBits < 16 && (n.windowBits += 16),
          this.err = 0,
          this.msg = "",
          this.ended = !1,
          this.chunks = [],
          this.strm = new s,
          this.strm.avail_out = 0;
        var r = e.deflateInit2(this.strm, n.level, n.method, n.windowBits, n.memLevel, n.strategy);
        if (r !== c)
          throw new Error(o[r]);
        if (n.header && e.deflateSetHeader(this.strm, n.header),
          n.dictionary) {
          var d;
          if (d = "string" == typeof n.dictionary ? a.string2buf(n.dictionary) : "[object ArrayBuffer]" === u.call(n.dictionary) ? new Uint8Array(n.dictionary) : n.dictionary,
          (r = e.deflateSetDictionary(this.strm, d)) !== c)
            throw new Error(o[r]);
          this._dict_set = !0
        }
      }

      function d(t, n) {
        var r = new l(n);
        if (r.push(t, !0),
          r.err)
          throw r.msg || o[r.err];
        return r.result
      }

      l.prototype.push = function (t, n) {
        var r, o, s = this.strm, f = this.options.chunkSize;
        if (this.ended)
          return !1;
        o = n === ~~n ? n : !0 === n ? 4 : 0,
          "string" == typeof t ? s.input = a.string2buf(t) : "[object ArrayBuffer]" === u.call(t) ? s.input = new Uint8Array(t) : s.input = t,
          s.next_in = 0,
          s.avail_in = s.input.length;
        do {
          if (0 === s.avail_out && (s.output = new i.Buf8(f),
            s.next_out = 0,
            s.avail_out = f),
          1 !== (r = e.deflate(s, o)) && r !== c)
            return this.onEnd(r),
              this.ended = !0,
              !1;
          0 !== s.avail_out && (0 !== s.avail_in || 4 !== o && 2 !== o) || ("string" === this.options.to ? this.onData(a.buf2binstring(i.shrinkBuf(s.output, s.next_out))) : this.onData(i.shrinkBuf(s.output, s.next_out)))
        } while ((s.avail_in > 0 || 0 === s.avail_out) && 1 !== r);
        return 4 === o ? (r = e.deflateEnd(this.strm),
          this.onEnd(r),
          this.ended = !0,
        r === c) : 2 !== o || (this.onEnd(c),
          s.avail_out = 0,
          !0)
      }
        ,
        l.prototype.onData = function (t) {
          this.chunks.push(t)
        }
        ,
        l.prototype.onEnd = function (t) {
          t === c && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = i.flattenChunks(this.chunks)),
            this.chunks = [],
            this.err = t,
            this.msg = this.strm.msg
        }
        ,
        n.Deflate = l,
        n.deflate = d,
        n.deflateRaw = function (t, n) {
          return (n = n || {}).raw = !0,
            d(t, n)
        }
        ,
        n.gzip = function (t, n) {
          return (n = n || {}).gzip = !0,
            d(t, n)
        }
    }
      , function (t, n, r) {
      "use strict";
      var e, i = r(0), a = r(11), o = r(12), s = r(13), u = r(3), c = 0, f = 4, h = 0, w = -2, l = -1, d = 1, _ = 4,
        p = 2, x = 8, g = 9, v = 286, b = 30, m = 19, y = 2 * v + 1, D = 15, C = 3, K = 258, k = K + C + 1, O = 42,
        z = 103, A = 113, B = 666, M = 1, q = 2, j = 3, T = 4;

      function Q(t, n) {
        return t.msg = u[n],
          n
      }

      function R(t) {
        return (t << 1) - (t > 4 ? 9 : 0)
      }

      function F(t) {
        for (var n = t.length; --n >= 0;)
          t[n] = 0
      }

      function S(t) {
        var n = t.state
          , r = n.pending;
        r > t.avail_out && (r = t.avail_out),
        0 !== r && (i.arraySet(t.output, n.pending_buf, n.pending_out, r, t.next_out),
          t.next_out += r,
          n.pending_out += r,
          t.total_out += r,
          t.avail_out -= r,
          n.pending -= r,
        0 === n.pending && (n.pending_out = 0))
      }

      function E(t, n) {
        a._tr_flush_block(t, t.block_start >= 0 ? t.block_start : -1, t.strstart - t.block_start, n),
          t.block_start = t.strstart,
          S(t.strm)
      }

      function U(t, n) {
        t.pending_buf[t.pending++] = n
      }

      function I(t, n) {
        t.pending_buf[t.pending++] = n >>> 8 & 255,
          t.pending_buf[t.pending++] = 255 & n
      }

      function H(t, n) {
        var r, e, i = t.max_chain_length, a = t.strstart, o = t.prev_length, s = t.nice_match,
          u = t.strstart > t.w_size - k ? t.strstart - (t.w_size - k) : 0, c = t.window, f = t.w_mask, h = t.prev,
          w = t.strstart + K, l = c[a + o - 1], d = c[a + o];
        t.prev_length >= t.good_match && (i >>= 2),
        s > t.lookahead && (s = t.lookahead);
        do {
          if (c[(r = n) + o] === d && c[r + o - 1] === l && c[r] === c[a] && c[++r] === c[a + 1]) {
            a += 2,
              r++;
            do {
            } while (c[++a] === c[++r] && c[++a] === c[++r] && c[++a] === c[++r] && c[++a] === c[++r] && c[++a] === c[++r] && c[++a] === c[++r] && c[++a] === c[++r] && c[++a] === c[++r] && a < w);
            if (e = K - (w - a),
              a = w - K,
            e > o) {
              if (t.match_start = n,
                o = e,
              e >= s)
                break;
              l = c[a + o - 1],
                d = c[a + o]
            }
          }
        } while ((n = h[n & f]) > u && 0 != --i);
        return o <= t.lookahead ? o : t.lookahead
      }

      function L(t) {
        var n, r, e, a, u, c, f, h, w, l, d = t.w_size;
        do {
          if (a = t.window_size - t.lookahead - t.strstart,
          t.strstart >= d + (d - k)) {
            i.arraySet(t.window, t.window, d, d, 0),
              t.match_start -= d,
              t.strstart -= d,
              t.block_start -= d,
              n = r = t.hash_size;
            do {
              e = t.head[--n],
                t.head[n] = e >= d ? e - d : 0
            } while (--r);
            n = r = d;
            do {
              e = t.prev[--n],
                t.prev[n] = e >= d ? e - d : 0
            } while (--r);
            a += d
          }
          if (0 === t.strm.avail_in)
            break;
          if (c = t.strm,
            f = t.window,
            h = t.strstart + t.lookahead,
            w = a,
            l = void 0,
          (l = c.avail_in) > w && (l = w),
            r = 0 === l ? 0 : (c.avail_in -= l,
              i.arraySet(f, c.input, c.next_in, l, h),
              1 === c.state.wrap ? c.adler = o(c.adler, f, l, h) : 2 === c.state.wrap && (c.adler = s(c.adler, f, l, h)),
              c.next_in += l,
              c.total_in += l,
              l),
            t.lookahead += r,
          t.lookahead + t.insert >= C)
            for (u = t.strstart - t.insert,
                   t.ins_h = t.window[u],
                   t.ins_h = (t.ins_h << t.hash_shift ^ t.window[u + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[u + C - 1]) & t.hash_mask,
              t.prev[u & t.w_mask] = t.head[t.ins_h],
              t.head[t.ins_h] = u,
              u++ ,
              t.insert-- ,
              !(t.lookahead + t.insert < C));)
              ;
        } while (t.lookahead < k && 0 !== t.strm.avail_in)
      }

      function J(t, n) {
        for (var r, e; ;) {
          if (t.lookahead < k) {
            if (L(t),
            t.lookahead < k && n === c)
              return M;
            if (0 === t.lookahead)
              break
          }
          if (r = 0,
          t.lookahead >= C && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask,
            r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h],
            t.head[t.ins_h] = t.strstart),
          0 !== r && t.strstart - r <= t.w_size - k && (t.match_length = H(t, r)),
          t.match_length >= C)
            if (e = a._tr_tally(t, t.strstart - t.match_start, t.match_length - C),
              t.lookahead -= t.match_length,
            t.match_length <= t.max_lazy_match && t.lookahead >= C) {
              t.match_length--;
              do {
                t.strstart++ ,
                  t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask,
                  r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h],
                  t.head[t.ins_h] = t.strstart
              } while (0 != --t.match_length);
              t.strstart++
            } else
              t.strstart += t.match_length,
                t.match_length = 0,
                t.ins_h = t.window[t.strstart],
                t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + 1]) & t.hash_mask;
          else
            e = a._tr_tally(t, 0, t.window[t.strstart]),
              t.lookahead-- ,
              t.strstart++;
          if (e && (E(t, !1),
          0 === t.strm.avail_out))
            return M
        }
        return t.insert = t.strstart < C - 1 ? t.strstart : C - 1,
          n === f ? (E(t, !0),
            0 === t.strm.avail_out ? j : T) : t.last_lit && (E(t, !1),
          0 === t.strm.avail_out) ? M : q
      }

      function V(t, n) {
        for (var r, e, i; ;) {
          if (t.lookahead < k) {
            if (L(t),
            t.lookahead < k && n === c)
              return M;
            if (0 === t.lookahead)
              break
          }
          if (r = 0,
          t.lookahead >= C && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask,
            r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h],
            t.head[t.ins_h] = t.strstart),
            t.prev_length = t.match_length,
            t.prev_match = t.match_start,
            t.match_length = C - 1,
          0 !== r && t.prev_length < t.max_lazy_match && t.strstart - r <= t.w_size - k && (t.match_length = H(t, r),
          t.match_length <= 5 && (t.strategy === d || t.match_length === C && t.strstart - t.match_start > 4096) && (t.match_length = C - 1)),
          t.prev_length >= C && t.match_length <= t.prev_length) {
            i = t.strstart + t.lookahead - C,
              e = a._tr_tally(t, t.strstart - 1 - t.prev_match, t.prev_length - C),
              t.lookahead -= t.prev_length - 1,
              t.prev_length -= 2;
            do {
              ++t.strstart <= i && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + C - 1]) & t.hash_mask,
                r = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h],
                t.head[t.ins_h] = t.strstart)
            } while (0 != --t.prev_length);
            if (t.match_available = 0,
              t.match_length = C - 1,
              t.strstart++ ,
            e && (E(t, !1),
            0 === t.strm.avail_out))
              return M
          } else if (t.match_available) {
            if ((e = a._tr_tally(t, 0, t.window[t.strstart - 1])) && E(t, !1),
              t.strstart++ ,
              t.lookahead-- ,
            0 === t.strm.avail_out)
              return M
          } else
            t.match_available = 1,
              t.strstart++ ,
              t.lookahead--
        }
        return t.match_available && (e = a._tr_tally(t, 0, t.window[t.strstart - 1]),
          t.match_available = 0),
          t.insert = t.strstart < C - 1 ? t.strstart : C - 1,
          n === f ? (E(t, !0),
            0 === t.strm.avail_out ? j : T) : t.last_lit && (E(t, !1),
          0 === t.strm.avail_out) ? M : q
      }

      function P(t, n, r, e, i) {
        this.good_length = t,
          this.max_lazy = n,
          this.nice_length = r,
          this.max_chain = e,
          this.func = i
      }

      function X(t) {
        var n;
        return t && t.state ? (t.total_in = t.total_out = 0,
          t.data_type = p,
          (n = t.state).pending = 0,
          n.pending_out = 0,
        n.wrap < 0 && (n.wrap = -n.wrap),
          n.status = n.wrap ? O : A,
          t.adler = 2 === n.wrap ? 0 : 1,
          n.last_flush = c,
          a._tr_init(n),
          h) : Q(t, w)
      }

      function Z(t) {
        var n, r = X(t);
        return r === h && ((n = t.state).window_size = 2 * n.w_size,
          F(n.head),
          n.max_lazy_match = e[n.level].max_lazy,
          n.good_match = e[n.level].good_length,
          n.nice_match = e[n.level].nice_length,
          n.max_chain_length = e[n.level].max_chain,
          n.strstart = 0,
          n.block_start = 0,
          n.lookahead = 0,
          n.insert = 0,
          n.match_length = n.prev_length = C - 1,
          n.match_available = 0,
          n.ins_h = 0),
          r
      }

      function N(t, n, r, e, a, o) {
        if (!t)
          return w;
        var s = 1;
        if (n === l && (n = 6),
          e < 0 ? (s = 0,
            e = -e) : e > 15 && (s = 2,
            e -= 16),
        a < 1 || a > g || r !== x || e < 8 || e > 15 || n < 0 || n > 9 || o < 0 || o > _)
          return Q(t, w);
        8 === e && (e = 9);
        var u = new function () {
            this.strm = null,
              this.status = 0,
              this.pending_buf = null,
              this.pending_buf_size = 0,
              this.pending_out = 0,
              this.pending = 0,
              this.wrap = 0,
              this.gzhead = null,
              this.gzindex = 0,
              this.method = x,
              this.last_flush = -1,
              this.w_size = 0,
              this.w_bits = 0,
              this.w_mask = 0,
              this.window = null,
              this.window_size = 0,
              this.prev = null,
              this.head = null,
              this.ins_h = 0,
              this.hash_size = 0,
              this.hash_bits = 0,
              this.hash_mask = 0,
              this.hash_shift = 0,
              this.block_start = 0,
              this.match_length = 0,
              this.prev_match = 0,
              this.match_available = 0,
              this.strstart = 0,
              this.match_start = 0,
              this.lookahead = 0,
              this.prev_length = 0,
              this.max_chain_length = 0,
              this.max_lazy_match = 0,
              this.level = 0,
              this.strategy = 0,
              this.good_match = 0,
              this.nice_match = 0,
              this.dyn_ltree = new i.Buf16(2 * y),
              this.dyn_dtree = new i.Buf16(2 * (2 * b + 1)),
              this.bl_tree = new i.Buf16(2 * (2 * m + 1)),
              F(this.dyn_ltree),
              F(this.dyn_dtree),
              F(this.bl_tree),
              this.l_desc = null,
              this.d_desc = null,
              this.bl_desc = null,
              this.bl_count = new i.Buf16(D + 1),
              this.heap = new i.Buf16(2 * v + 1),
              F(this.heap),
              this.heap_len = 0,
              this.heap_max = 0,
              this.depth = new i.Buf16(2 * v + 1),
              F(this.depth),
              this.l_buf = 0,
              this.lit_bufsize = 0,
              this.last_lit = 0,
              this.d_buf = 0,
              this.opt_len = 0,
              this.static_len = 0,
              this.matches = 0,
              this.insert = 0,
              this.bi_buf = 0,
              this.bi_valid = 0
          }
        ;
        return t.state = u,
          u.strm = t,
          u.wrap = s,
          u.gzhead = null,
          u.w_bits = e,
          u.w_size = 1 << u.w_bits,
          u.w_mask = u.w_size - 1,
          u.hash_bits = a + 7,
          u.hash_size = 1 << u.hash_bits,
          u.hash_mask = u.hash_size - 1,
          u.hash_shift = ~~((u.hash_bits + C - 1) / C),
          u.window = new i.Buf8(2 * u.w_size),
          u.head = new i.Buf16(u.hash_size),
          u.prev = new i.Buf16(u.w_size),
          u.lit_bufsize = 1 << a + 6,
          u.pending_buf_size = 4 * u.lit_bufsize,
          u.pending_buf = new i.Buf8(u.pending_buf_size),
          u.d_buf = 1 * u.lit_bufsize,
          u.l_buf = 3 * u.lit_bufsize,
          u.level = n,
          u.strategy = o,
          u.method = r,
          Z(t)
      }

      e = [new P(0, 0, 0, 0, function (t, n) {
          var r = 65535;
          for (r > t.pending_buf_size - 5 && (r = t.pending_buf_size - 5); ;) {
            if (t.lookahead <= 1) {
              if (L(t),
              0 === t.lookahead && n === c)
                return M;
              if (0 === t.lookahead)
                break
            }
            t.strstart += t.lookahead,
              t.lookahead = 0;
            var e = t.block_start + r;
            if ((0 === t.strstart || t.strstart >= e) && (t.lookahead = t.strstart - e,
              t.strstart = e,
              E(t, !1),
            0 === t.strm.avail_out))
              return M;
            if (t.strstart - t.block_start >= t.w_size - k && (E(t, !1),
            0 === t.strm.avail_out))
              return M
          }
          return t.insert = 0,
            n === f ? (E(t, !0),
              0 === t.strm.avail_out ? j : T) : (t.strstart > t.block_start && (E(t, !1),
              t.strm.avail_out),
              M)
        }
      ), new P(4, 4, 8, 4, J), new P(4, 5, 16, 8, J), new P(4, 6, 32, 32, J), new P(4, 4, 16, 16, V), new P(8, 16, 32, 32, V), new P(8, 16, 128, 128, V), new P(8, 32, 128, 256, V), new P(32, 128, 258, 1024, V), new P(32, 258, 258, 4096, V)],
        n.deflateInit = function (t, n) {
          return N(t, n, x, 15, 8, 0)
        }
        ,
        n.deflateInit2 = N,
        n.deflateReset = Z,
        n.deflateResetKeep = X,
        n.deflateSetHeader = function (t, n) {
          return t && t.state ? 2 !== t.state.wrap ? w : (t.state.gzhead = n,
            h) : w
        }
        ,
        n.deflate = function (t, n) {
          var r, i, o, u;
          if (!t || !t.state || n > 5 || n < 0)
            return t ? Q(t, w) : w;
          if (i = t.state,
          !t.output || !t.input && 0 !== t.avail_in || i.status === B && n !== f)
            return Q(t, 0 === t.avail_out ? -5 : w);
          if (i.strm = t,
            r = i.last_flush,
            i.last_flush = n,
          i.status === O)
            if (2 === i.wrap)
              t.adler = 0,
                U(i, 31),
                U(i, 139),
                U(i, 8),
                i.gzhead ? (U(i, (i.gzhead.text ? 1 : 0) + (i.gzhead.hcrc ? 2 : 0) + (i.gzhead.extra ? 4 : 0) + (i.gzhead.name ? 8 : 0) + (i.gzhead.comment ? 16 : 0)),
                  U(i, 255 & i.gzhead.time),
                  U(i, i.gzhead.time >> 8 & 255),
                  U(i, i.gzhead.time >> 16 & 255),
                  U(i, i.gzhead.time >> 24 & 255),
                  U(i, 9 === i.level ? 2 : i.strategy >= 2 || i.level < 2 ? 4 : 0),
                  U(i, 255 & i.gzhead.os),
                i.gzhead.extra && i.gzhead.extra.length && (U(i, 255 & i.gzhead.extra.length),
                  U(i, i.gzhead.extra.length >> 8 & 255)),
                i.gzhead.hcrc && (t.adler = s(t.adler, i.pending_buf, i.pending, 0)),
                  i.gzindex = 0,
                  i.status = 69) : (U(i, 0),
                  U(i, 0),
                  U(i, 0),
                  U(i, 0),
                  U(i, 0),
                  U(i, 9 === i.level ? 2 : i.strategy >= 2 || i.level < 2 ? 4 : 0),
                  U(i, 3),
                  i.status = A);
            else {
              var l = x + (i.w_bits - 8 << 4) << 8;
              l |= (i.strategy >= 2 || i.level < 2 ? 0 : i.level < 6 ? 1 : 6 === i.level ? 2 : 3) << 6,
              0 !== i.strstart && (l |= 32),
                l += 31 - l % 31,
                i.status = A,
                I(i, l),
              0 !== i.strstart && (I(i, t.adler >>> 16),
                I(i, 65535 & t.adler)),
                t.adler = 1
            }
          if (69 === i.status)
            if (i.gzhead.extra) {
              for (o = i.pending; i.gzindex < (65535 & i.gzhead.extra.length) && (i.pending !== i.pending_buf_size || (i.gzhead.hcrc && i.pending > o && (t.adler = s(t.adler, i.pending_buf, i.pending - o, o)),
                S(t),
                o = i.pending,
              i.pending !== i.pending_buf_size));)
                U(i, 255 & i.gzhead.extra[i.gzindex]),
                  i.gzindex++;
              i.gzhead.hcrc && i.pending > o && (t.adler = s(t.adler, i.pending_buf, i.pending - o, o)),
              i.gzindex === i.gzhead.extra.length && (i.gzindex = 0,
                i.status = 73)
            } else
              i.status = 73;
          if (73 === i.status)
            if (i.gzhead.name) {
              o = i.pending;
              do {
                if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (t.adler = s(t.adler, i.pending_buf, i.pending - o, o)),
                  S(t),
                  o = i.pending,
                i.pending === i.pending_buf_size)) {
                  u = 1;
                  break
                }
                u = i.gzindex < i.gzhead.name.length ? 255 & i.gzhead.name.charCodeAt(i.gzindex++) : 0,
                  U(i, u)
              } while (0 !== u);
              i.gzhead.hcrc && i.pending > o && (t.adler = s(t.adler, i.pending_buf, i.pending - o, o)),
              0 === u && (i.gzindex = 0,
                i.status = 91)
            } else
              i.status = 91;
          if (91 === i.status)
            if (i.gzhead.comment) {
              o = i.pending;
              do {
                if (i.pending === i.pending_buf_size && (i.gzhead.hcrc && i.pending > o && (t.adler = s(t.adler, i.pending_buf, i.pending - o, o)),
                  S(t),
                  o = i.pending,
                i.pending === i.pending_buf_size)) {
                  u = 1;
                  break
                }
                u = i.gzindex < i.gzhead.comment.length ? 255 & i.gzhead.comment.charCodeAt(i.gzindex++) : 0,
                  U(i, u)
              } while (0 !== u);
              i.gzhead.hcrc && i.pending > o && (t.adler = s(t.adler, i.pending_buf, i.pending - o, o)),
              0 === u && (i.status = z)
            } else
              i.status = z;
          if (i.status === z && (i.gzhead.hcrc ? (i.pending + 2 > i.pending_buf_size && S(t),
          i.pending + 2 <= i.pending_buf_size && (U(i, 255 & t.adler),
            U(i, t.adler >> 8 & 255),
            t.adler = 0,
            i.status = A)) : i.status = A),
          0 !== i.pending) {
            if (S(t),
            0 === t.avail_out)
              return i.last_flush = -1,
                h
          } else if (0 === t.avail_in && R(n) <= R(r) && n !== f)
            return Q(t, -5);
          if (i.status === B && 0 !== t.avail_in)
            return Q(t, -5);
          if (0 !== t.avail_in || 0 !== i.lookahead || n !== c && i.status !== B) {
            var d = 2 === i.strategy ? function (t, n) {
              for (var r; ;) {
                if (0 === t.lookahead && (L(t),
                0 === t.lookahead)) {
                  if (n === c)
                    return M;
                  break
                }
                if (t.match_length = 0,
                  r = a._tr_tally(t, 0, t.window[t.strstart]),
                  t.lookahead-- ,
                  t.strstart++ ,
                r && (E(t, !1),
                0 === t.strm.avail_out))
                  return M
              }
              return t.insert = 0,
                n === f ? (E(t, !0),
                  0 === t.strm.avail_out ? j : T) : t.last_lit && (E(t, !1),
                0 === t.strm.avail_out) ? M : q
            }(i, n) : 3 === i.strategy ? function (t, n) {
              for (var r, e, i, o, s = t.window; ;) {
                if (t.lookahead <= K) {
                  if (L(t),
                  t.lookahead <= K && n === c)
                    return M;
                  if (0 === t.lookahead)
                    break
                }
                if (t.match_length = 0,
                t.lookahead >= C && t.strstart > 0 && (e = s[i = t.strstart - 1]) === s[++i] && e === s[++i] && e === s[++i]) {
                  o = t.strstart + K;
                  do {
                  } while (e === s[++i] && e === s[++i] && e === s[++i] && e === s[++i] && e === s[++i] && e === s[++i] && e === s[++i] && e === s[++i] && i < o);
                  t.match_length = K - (o - i),
                  t.match_length > t.lookahead && (t.match_length = t.lookahead)
                }
                if (t.match_length >= C ? (r = a._tr_tally(t, 1, t.match_length - C),
                  t.lookahead -= t.match_length,
                  t.strstart += t.match_length,
                  t.match_length = 0) : (r = a._tr_tally(t, 0, t.window[t.strstart]),
                  t.lookahead-- ,
                  t.strstart++),
                r && (E(t, !1),
                0 === t.strm.avail_out))
                  return M
              }
              return t.insert = 0,
                n === f ? (E(t, !0),
                  0 === t.strm.avail_out ? j : T) : t.last_lit && (E(t, !1),
                0 === t.strm.avail_out) ? M : q
            }(i, n) : e[i.level].func(i, n);
            if (d !== j && d !== T || (i.status = B),
            d === M || d === j)
              return 0 === t.avail_out && (i.last_flush = -1),
                h;
            if (d === q && (1 === n ? a._tr_align(i) : 5 !== n && (a._tr_stored_block(i, 0, 0, !1),
            3 === n && (F(i.head),
            0 === i.lookahead && (i.strstart = 0,
              i.block_start = 0,
              i.insert = 0))),
              S(t),
            0 === t.avail_out))
              return i.last_flush = -1,
                h
          }
          return n !== f ? h : i.wrap <= 0 ? 1 : (2 === i.wrap ? (U(i, 255 & t.adler),
            U(i, t.adler >> 8 & 255),
            U(i, t.adler >> 16 & 255),
            U(i, t.adler >> 24 & 255),
            U(i, 255 & t.total_in),
            U(i, t.total_in >> 8 & 255),
            U(i, t.total_in >> 16 & 255),
            U(i, t.total_in >> 24 & 255)) : (I(i, t.adler >>> 16),
            I(i, 65535 & t.adler)),
            S(t),
          i.wrap > 0 && (i.wrap = -i.wrap),
            0 !== i.pending ? h : 1)
        }
        ,
        n.deflateEnd = function (t) {
          var n;
          return t && t.state ? (n = t.state.status) !== O && 69 !== n && 73 !== n && 91 !== n && n !== z && n !== A && n !== B ? Q(t, w) : (t.state = null,
            n === A ? Q(t, -3) : h) : w
        }
        ,
        n.deflateSetDictionary = function (t, n) {
          var r, e, a, s, u, c, f, l, d = n.length;
          if (!t || !t.state)
            return w;
          if (2 === (s = (r = t.state).wrap) || 1 === s && r.status !== O || r.lookahead)
            return w;
          for (1 === s && (t.adler = o(t.adler, n, d, 0)),
                 r.wrap = 0,
               d >= r.w_size && (0 === s && (F(r.head),
                 r.strstart = 0,
                 r.block_start = 0,
                 r.insert = 0),
                 l = new i.Buf8(r.w_size),
                 i.arraySet(l, n, d - r.w_size, r.w_size, 0),
                 n = l,
                 d = r.w_size),
                 u = t.avail_in,
                 c = t.next_in,
                 f = t.input,
                 t.avail_in = d,
                 t.next_in = 0,
                 t.input = n,
                 L(r); r.lookahead >= C;) {
            e = r.strstart,
              a = r.lookahead - (C - 1);
            do {
              r.ins_h = (r.ins_h << r.hash_shift ^ r.window[e + C - 1]) & r.hash_mask,
                r.prev[e & r.w_mask] = r.head[r.ins_h],
                r.head[r.ins_h] = e,
                e++
            } while (--a);
            r.strstart = e,
              r.lookahead = C - 1,
              L(r)
          }
          return r.strstart += r.lookahead,
            r.block_start = r.strstart,
            r.insert = r.lookahead,
            r.lookahead = 0,
            r.match_length = r.prev_length = C - 1,
            r.match_available = 0,
            t.next_in = c,
            t.input = f,
            t.avail_in = u,
            r.wrap = s,
            h
        }
        ,
        n.deflateInfo = "pako deflate (from Nodeca project)"
    }
      , function (t, n, r) {
      "use strict";
      var e = r(0);

      function i(t) {
        for (var n = t.length; --n >= 0;)
          t[n] = 0
      }

      var a = 0
        , o = 256
        , s = o + 1 + 29
        , u = 30
        , c = 19
        , f = 2 * s + 1
        , h = 15
        , w = 16
        , l = 256
        , d = 16
        , _ = 17
        , p = 18
        , x = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0]
        , g = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13]
        , v = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7]
        , b = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]
        , m = new Array(2 * (s + 2));
      i(m);
      var y = new Array(2 * u);
      i(y);
      var D = new Array(512);
      i(D);
      var C = new Array(256);
      i(C);
      var K = new Array(29);
      i(K);
      var k, O, z, A = new Array(u);

      function B(t, n, r, e, i) {
        this.static_tree = t,
          this.extra_bits = n,
          this.extra_base = r,
          this.elems = e,
          this.max_length = i,
          this.has_stree = t && t.length
      }

      function M(t, n) {
        this.dyn_tree = t,
          this.max_code = 0,
          this.stat_desc = n
      }

      function q(t) {
        return t < 256 ? D[t] : D[256 + (t >>> 7)]
      }

      function j(t, n) {
        t.pending_buf[t.pending++] = 255 & n,
          t.pending_buf[t.pending++] = n >>> 8 & 255
      }

      function T(t, n, r) {
        t.bi_valid > w - r ? (t.bi_buf |= n << t.bi_valid & 65535,
          j(t, t.bi_buf),
          t.bi_buf = n >> w - t.bi_valid,
          t.bi_valid += r - w) : (t.bi_buf |= n << t.bi_valid & 65535,
          t.bi_valid += r)
      }

      function Q(t, n, r) {
        T(t, r[2 * n], r[2 * n + 1])
      }

      function R(t, n) {
        var r = 0;
        do {
          r |= 1 & t,
            t >>>= 1,
            r <<= 1
        } while (--n > 0);
        return r >>> 1
      }

      function F(t, n, r) {
        var e, i, a = new Array(h + 1), o = 0;
        for (e = 1; e <= h; e++)
          a[e] = o = o + r[e - 1] << 1;
        for (i = 0; i <= n; i++) {
          var s = t[2 * i + 1];
          0 !== s && (t[2 * i] = R(a[s]++, s))
        }
      }

      function S(t) {
        var n;
        for (n = 0; n < s; n++)
          t.dyn_ltree[2 * n] = 0;
        for (n = 0; n < u; n++)
          t.dyn_dtree[2 * n] = 0;
        for (n = 0; n < c; n++)
          t.bl_tree[2 * n] = 0;
        t.dyn_ltree[2 * l] = 1,
          t.opt_len = t.static_len = 0,
          t.last_lit = t.matches = 0
      }

      function E(t) {
        t.bi_valid > 8 ? j(t, t.bi_buf) : t.bi_valid > 0 && (t.pending_buf[t.pending++] = t.bi_buf),
          t.bi_buf = 0,
          t.bi_valid = 0
      }

      function U(t, n, r, e) {
        var i = 2 * n
          , a = 2 * r;
        return t[i] < t[a] || t[i] === t[a] && e[n] <= e[r]
      }

      function I(t, n, r) {
        for (var e = t.heap[r], i = r << 1; i <= t.heap_len && (i < t.heap_len && U(n, t.heap[i + 1], t.heap[i], t.depth) && i++ ,
          !U(n, e, t.heap[i], t.depth));)
          t.heap[r] = t.heap[i],
            r = i,
            i <<= 1;
        t.heap[r] = e
      }

      function H(t, n, r) {
        var e, i, a, s, u = 0;
        if (0 !== t.last_lit)
          do {
            e = t.pending_buf[t.d_buf + 2 * u] << 8 | t.pending_buf[t.d_buf + 2 * u + 1],
              i = t.pending_buf[t.l_buf + u],
              u++ ,
              0 === e ? Q(t, i, n) : (Q(t, (a = C[i]) + o + 1, n),
              0 !== (s = x[a]) && T(t, i -= K[a], s),
                Q(t, a = q(--e), r),
              0 !== (s = g[a]) && T(t, e -= A[a], s))
          } while (u < t.last_lit);
        Q(t, l, n)
      }

      function L(t, n) {
        var r, e, i, a = n.dyn_tree, o = n.stat_desc.static_tree, s = n.stat_desc.has_stree, u = n.stat_desc.elems,
          c = -1;
        for (t.heap_len = 0,
               t.heap_max = f,
               r = 0; r < u; r++)
          0 !== a[2 * r] ? (t.heap[++t.heap_len] = c = r,
            t.depth[r] = 0) : a[2 * r + 1] = 0;
        for (; t.heap_len < 2;)
          a[2 * (i = t.heap[++t.heap_len] = c < 2 ? ++c : 0)] = 1,
            t.depth[i] = 0,
            t.opt_len-- ,
          s && (t.static_len -= o[2 * i + 1]);
        for (n.max_code = c,
               r = t.heap_len >> 1; r >= 1; r--)
          I(t, a, r);
        i = u;
        do {
          r = t.heap[1],
            t.heap[1] = t.heap[t.heap_len--],
            I(t, a, 1),
            e = t.heap[1],
            t.heap[--t.heap_max] = r,
            t.heap[--t.heap_max] = e,
            a[2 * i] = a[2 * r] + a[2 * e],
            t.depth[i] = (t.depth[r] >= t.depth[e] ? t.depth[r] : t.depth[e]) + 1,
            a[2 * r + 1] = a[2 * e + 1] = i,
            t.heap[1] = i++ ,
            I(t, a, 1)
        } while (t.heap_len >= 2);
        t.heap[--t.heap_max] = t.heap[1],
          function (t, n) {
            var r, e, i, a, o, s, u = n.dyn_tree, c = n.max_code, w = n.stat_desc.static_tree,
              l = n.stat_desc.has_stree, d = n.stat_desc.extra_bits, _ = n.stat_desc.extra_base,
              p = n.stat_desc.max_length, x = 0;
            for (a = 0; a <= h; a++)
              t.bl_count[a] = 0;
            for (u[2 * t.heap[t.heap_max] + 1] = 0,
                   r = t.heap_max + 1; r < f; r++)
              (a = u[2 * u[2 * (e = t.heap[r]) + 1] + 1] + 1) > p && (a = p,
                x++),
                u[2 * e + 1] = a,
              e > c || (t.bl_count[a]++ ,
                o = 0,
              e >= _ && (o = d[e - _]),
                s = u[2 * e],
                t.opt_len += s * (a + o),
              l && (t.static_len += s * (w[2 * e + 1] + o)));
            if (0 !== x) {
              do {
                for (a = p - 1; 0 === t.bl_count[a];)
                  a--;
                t.bl_count[a]-- ,
                  t.bl_count[a + 1] += 2,
                  t.bl_count[p]-- ,
                  x -= 2
              } while (x > 0);
              for (a = p; 0 !== a; a--)
                for (e = t.bl_count[a]; 0 !== e;)
                  (i = t.heap[--r]) > c || (u[2 * i + 1] !== a && (t.opt_len += (a - u[2 * i + 1]) * u[2 * i],
                    u[2 * i + 1] = a),
                    e--)
            }
          }(t, n),
          F(a, c, t.bl_count)
      }

      function J(t, n, r) {
        var e, i, a = -1, o = n[1], s = 0, u = 7, c = 4;
        for (0 === o && (u = 138,
          c = 3),
               n[2 * (r + 1) + 1] = 65535,
               e = 0; e <= r; e++)
          i = o,
            o = n[2 * (e + 1) + 1],
          ++s < u && i === o || (s < c ? t.bl_tree[2 * i] += s : 0 !== i ? (i !== a && t.bl_tree[2 * i]++ ,
            t.bl_tree[2 * d]++) : s <= 10 ? t.bl_tree[2 * _]++ : t.bl_tree[2 * p]++ ,
            s = 0,
            a = i,
            0 === o ? (u = 138,
              c = 3) : i === o ? (u = 6,
              c = 3) : (u = 7,
              c = 4))
      }

      function V(t, n, r) {
        var e, i, a = -1, o = n[1], s = 0, u = 7, c = 4;
        for (0 === o && (u = 138,
          c = 3),
               e = 0; e <= r; e++)
          if (i = o,
            o = n[2 * (e + 1) + 1],
            !(++s < u && i === o)) {
            if (s < c)
              do {
                Q(t, i, t.bl_tree)
              } while (0 != --s);
            else
              0 !== i ? (i !== a && (Q(t, i, t.bl_tree),
                s--),
                Q(t, d, t.bl_tree),
                T(t, s - 3, 2)) : s <= 10 ? (Q(t, _, t.bl_tree),
                T(t, s - 3, 3)) : (Q(t, p, t.bl_tree),
                T(t, s - 11, 7));
            s = 0,
              a = i,
              0 === o ? (u = 138,
                c = 3) : i === o ? (u = 6,
                c = 3) : (u = 7,
                c = 4)
          }
      }

      i(A);
      var P = !1;

      function X(t, n, r, i) {
        T(t, (a << 1) + (i ? 1 : 0), 3),
          function (t, n, r, i) {
            E(t),
              j(t, r),
              j(t, ~r),
              e.arraySet(t.pending_buf, t.window, n, r, t.pending),
              t.pending += r
          }(t, n, r)
      }

      n._tr_init = function (t) {
        P || (function () {
          var t, n, r, e, i, a = new Array(h + 1);
          for (r = 0,
                 e = 0; e < 28; e++)
            for (K[e] = r,
                   t = 0; t < 1 << x[e]; t++)
              C[r++] = e;
          for (C[r - 1] = e,
                 i = 0,
                 e = 0; e < 16; e++)
            for (A[e] = i,
                   t = 0; t < 1 << g[e]; t++)
              D[i++] = e;
          for (i >>= 7; e < u; e++)
            for (A[e] = i << 7,
                   t = 0; t < 1 << g[e] - 7; t++)
              D[256 + i++] = e;
          for (n = 0; n <= h; n++)
            a[n] = 0;
          for (t = 0; t <= 143;)
            m[2 * t + 1] = 8,
              t++ ,
              a[8]++;
          for (; t <= 255;)
            m[2 * t + 1] = 9,
              t++ ,
              a[9]++;
          for (; t <= 279;)
            m[2 * t + 1] = 7,
              t++ ,
              a[7]++;
          for (; t <= 287;)
            m[2 * t + 1] = 8,
              t++ ,
              a[8]++;
          for (F(m, s + 1, a),
                 t = 0; t < u; t++)
            y[2 * t + 1] = 5,
              y[2 * t] = R(t, 5);
          k = new B(m, x, o + 1, s, h),
            O = new B(y, g, 0, u, h),
            z = new B(new Array(0), v, 0, c, 7)
        }(),
          P = !0),
          t.l_desc = new M(t.dyn_ltree, k),
          t.d_desc = new M(t.dyn_dtree, O),
          t.bl_desc = new M(t.bl_tree, z),
          t.bi_buf = 0,
          t.bi_valid = 0,
          S(t)
      }
        ,
        n._tr_stored_block = X,
        n._tr_flush_block = function (t, n, r, e) {
          var i, a, s = 0;
          t.level > 0 ? (2 === t.strm.data_type && (t.strm.data_type = function (t) {
            var n, r = 4093624447;
            for (n = 0; n <= 31; n++ ,
              r >>>= 1)
              if (1 & r && 0 !== t.dyn_ltree[2 * n])
                return 0;
            if (0 !== t.dyn_ltree[18] || 0 !== t.dyn_ltree[20] || 0 !== t.dyn_ltree[26])
              return 1;
            for (n = 32; n < o; n++)
              if (0 !== t.dyn_ltree[2 * n])
                return 1;
            return 0
          }(t)),
            L(t, t.l_desc),
            L(t, t.d_desc),
            s = function (t) {
              var n;
              for (J(t, t.dyn_ltree, t.l_desc.max_code),
                     J(t, t.dyn_dtree, t.d_desc.max_code),
                     L(t, t.bl_desc),
                     n = c - 1; n >= 3 && 0 === t.bl_tree[2 * b[n] + 1]; n--)
                ;
              return t.opt_len += 3 * (n + 1) + 5 + 5 + 4,
                n
            }(t),
            i = t.opt_len + 3 + 7 >>> 3,
          (a = t.static_len + 3 + 7 >>> 3) <= i && (i = a)) : i = a = r + 5,
            r + 4 <= i && -1 !== n ? X(t, n, r, e) : 4 === t.strategy || a === i ? (T(t, 2 + (e ? 1 : 0), 3),
              H(t, m, y)) : (T(t, 4 + (e ? 1 : 0), 3),
              function (t, n, r, e) {
                var i;
                for (T(t, n - 257, 5),
                       T(t, r - 1, 5),
                       T(t, e - 4, 4),
                       i = 0; i < e; i++)
                  T(t, t.bl_tree[2 * b[i] + 1], 3);
                V(t, t.dyn_ltree, n - 1),
                  V(t, t.dyn_dtree, r - 1)
              }(t, t.l_desc.max_code + 1, t.d_desc.max_code + 1, s + 1),
              H(t, t.dyn_ltree, t.dyn_dtree)),
            S(t),
          e && E(t)
        }
        ,
        n._tr_tally = function (t, n, r) {
          return t.pending_buf[t.d_buf + 2 * t.last_lit] = n >>> 8 & 255,
            t.pending_buf[t.d_buf + 2 * t.last_lit + 1] = 255 & n,
            t.pending_buf[t.l_buf + t.last_lit] = 255 & r,
            t.last_lit++ ,
            0 === n ? t.dyn_ltree[2 * r]++ : (t.matches++ ,
              n-- ,
              t.dyn_ltree[2 * (C[r] + o + 1)]++ ,
              t.dyn_dtree[2 * q(n)]++),
          t.last_lit === t.lit_bufsize - 1
        }
        ,
        n._tr_align = function (t) {
          T(t, 2, 3),
            Q(t, l, m),
            function (t) {
              16 === t.bi_valid ? (j(t, t.bi_buf),
                t.bi_buf = 0,
                t.bi_valid = 0) : t.bi_valid >= 8 && (t.pending_buf[t.pending++] = 255 & t.bi_buf,
                t.bi_buf >>= 8,
                t.bi_valid -= 8)
            }(t)
        }
    }
      , function (t, n, r) {
      "use strict";
      t.exports = function (t, n, r, e) {
        for (var i = 65535 & t | 0, a = t >>> 16 & 65535 | 0, o = 0; 0 !== r;) {
          r -= o = r > 2e3 ? 2e3 : r;
          do {
            a = a + (i = i + n[e++] | 0) | 0
          } while (--o);
          i %= 65521,
            a %= 65521
        }
        return i | a << 16 | 0
      }
    }
      , function (t, n, r) {
      "use strict";
      var e = function () {
        for (var t, n = [], r = 0; r < 256; r++) {
          t = r;
          for (var e = 0; e < 8; e++)
            t = 1 & t ? 3988292384 ^ t >>> 1 : t >>> 1;
          n[r] = t
        }
        return n
      }();
      t.exports = function (t, n, r, i) {
        var a = e
          , o = i + r;
        t ^= -1;
        for (var s = i; s < o; s++)
          t = t >>> 8 ^ a[255 & (t ^ n[s])];
        return -1 ^ t
      }
    }
      , function (t, n, r) {
      "use strict";
      var e = r(0)
        , i = !0
        , a = !0;
      try {
        String.fromCharCode.apply(null, [0])
      } catch (t) {
        i = !1
      }
      try {
        String.fromCharCode.apply(null, new Uint8Array(1))
      } catch (t) {
        a = !1
      }
      for (var o = new e.Buf8(256), s = 0; s < 256; s++)
        o[s] = s >= 252 ? 6 : s >= 248 ? 5 : s >= 240 ? 4 : s >= 224 ? 3 : s >= 192 ? 2 : 1;

      function u(t, n) {
        if (n < 65534 && (t.subarray && a || !t.subarray && i))
          return String.fromCharCode.apply(null, e.shrinkBuf(t, n));
        for (var r = "", o = 0; o < n; o++)
          r += String.fromCharCode(t[o]);
        return r
      }

      o[254] = o[254] = 1,
        n.string2buf = function (t) {
          var n, r, i, a, o, s = t.length, u = 0;
          for (a = 0; a < s; a++)
            55296 == (64512 & (r = t.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (i = t.charCodeAt(a + 1))) && (r = 65536 + (r - 55296 << 10) + (i - 56320),
              a++),
              u += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4;
          for (n = new e.Buf8(u),
                 o = 0,
                 a = 0; o < u; a++)
            55296 == (64512 & (r = t.charCodeAt(a))) && a + 1 < s && 56320 == (64512 & (i = t.charCodeAt(a + 1))) && (r = 65536 + (r - 55296 << 10) + (i - 56320),
              a++),
              r < 128 ? n[o++] = r : r < 2048 ? (n[o++] = 192 | r >>> 6,
                n[o++] = 128 | 63 & r) : r < 65536 ? (n[o++] = 224 | r >>> 12,
                n[o++] = 128 | r >>> 6 & 63,
                n[o++] = 128 | 63 & r) : (n[o++] = 240 | r >>> 18,
                n[o++] = 128 | r >>> 12 & 63,
                n[o++] = 128 | r >>> 6 & 63,
                n[o++] = 128 | 63 & r);
          return n
        }
        ,
        n.buf2binstring = function (t) {
          return u(t, t.length)
        }
        ,
        n.binstring2buf = function (t) {
          for (var n = new e.Buf8(t.length), r = 0, i = n.length; r < i; r++)
            n[r] = t.charCodeAt(r);
          return n
        }
        ,
        n.buf2string = function (t, n) {
          var r, e, i, a, s = n || t.length, c = new Array(2 * s);
          for (e = 0,
                 r = 0; r < s;)
            if ((i = t[r++]) < 128)
              c[e++] = i;
            else if ((a = o[i]) > 4)
              c[e++] = 65533,
                r += a - 1;
            else {
              for (i &= 2 === a ? 31 : 3 === a ? 15 : 7; a > 1 && r < s;)
                i = i << 6 | 63 & t[r++],
                  a--;
              a > 1 ? c[e++] = 65533 : i < 65536 ? c[e++] = i : (i -= 65536,
                c[e++] = 55296 | i >> 10 & 1023,
                c[e++] = 56320 | 1023 & i)
            }
          return u(c, e)
        }
        ,
        n.utf8border = function (t, n) {
          var r;
          for ((n = n || t.length) > t.length && (n = t.length),
                 r = n - 1; r >= 0 && 128 == (192 & t[r]);)
            r--;
          return r < 0 ? n : 0 === r ? n : r + o[t[r]] > n ? r : n
        }
    }
      , function (t, n, r) {
      "use strict";
      t.exports = function () {
        this.input = null,
          this.next_in = 0,
          this.avail_in = 0,
          this.total_in = 0,
          this.output = null,
          this.next_out = 0,
          this.avail_out = 0,
          this.total_out = 0,
          this.msg = "",
          this.state = null,
          this.data_type = 2,
          this.adler = 0
      }
    }
      , function (t, n, r) {
      (function (t) {
          var n, e, i = "function" == typeof _ && "symbol" == x(w) ? function (t) {
              return x(t)
            }
            : function (t) {
              return t && "function" == typeof _ && t.constructor === _ && t !== _.prototype ? "symbol" : x(t)
            }
            , a = r(4), o = r(17), s = r(18),
            u = ["QzwKMQ4=", "w6fCisOpFyEo", "w7LDkcKMw4F9", "wqLDlVkyLG7Cvg==", "w4nDvHUmUg==", "CGTDnk7DoMO0Eg==", "woBEw60FeA==", "w684w4vDhWM=", "w7HDv2zDocKF", "w7LDmcK9KTQ=", "LcOPWsKmwro=", "w7A+FDZH", "w4PCvSM=", "KMOiaA==", "RMOiwq3CjsOr", "wqLDhEI=", "WcOOdlx8", "w7HDs8K9w55Bw4cs", "JMK5IcOPRcOawrjDgMKq", "a8KKw5bCk8OdcxjCjW/DlcO1w7Y=", "LcOyw5LDiyES", "ecOAwp7Cg8O1w6o3w6k=", "wqzCt8K5wr8Zw5M=", "wo0HwpQSw6bDosKTYsO2", "PMOiaMKrez3CkCBs", "DMKLZkFBw50Lwqlvw7k=", "wq/Cq8K9w5BHw5tiXA==", "w4vDvnkvSMK8w4t7w4U=", "w6bDi8KLwq3ClcKJR8KkZlQ=", "wrvDkG9HY8OVFS/CqQQ=", "wph9w6w=", "wpsWR8KTwog=", "wqhfwobDr8KJ", "wqDCkklGTg==", "w7LDuX/DsMKY", "flXCtwhS", "w63DlcKvwoPCkQ==", "UBYOOB56", "w6bDvMK1w59h", "wpMvw5M8Jg==", "UzfCosOewog=", "L0DDtV7DjA==", "fmk/w7jCuQ==", "YMKzw6/DmQLDrw==", "w7/CszLDi8O+I8OuHMKGSQ==", "w6gZw6vDvUY=", "wrkewp4Nw6I=", "GCJdwqvClw==", "T8OzRR/ClXPChw==", "JXwNwo3Cjg==", "YBYIID8=", "fsOHwpzChMOZw7s=", "wpQsw68vMwrDng8jw5UK", "w6/CtzrDmsOY", "wojDrGY4Pg==", "wpYMwoUSw40=", "wpfCj2ZfUg==", "IcOmcsKHSzTCiw==", "RcOIV3Z9"];
          n = u,
            e = 136,
            function (t) {
              for (; --t;)
                n.push(n.shift())
            }(++e);
          var c = function t(n, r) {
            var e, i = u[n -= 0];
            void 0 === t.KnuQDT && ((e = function () {
              var t;
              try {
                t = Function('return (function() {}.constructor("return this")( ));')()
              } catch (n) {
                t = window
              }
              return t
            }()).atob || (e.atob = function (t) {
                for (var n, r, e = String(t).replace(/=+$/, ""), i = 0, a = 0, o = ""; r = e.charAt(a++); ~r && (n = i % 4 ? 64 * n + r : r,
                i++ % 4) ? o += String.fromCharCode(255 & n >> (-2 * i & 6)) : 0)
                  r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);
                return o
              }
            ),
              t.fyxzDe = function (t, n) {
                for (var r, e = [], i = 0, a = "", o = "", s = 0, u = (t = atob(t)).length; s < u; s++)
                  o += "%" + ("00" + t.charCodeAt(s).toString(16)).slice(-2);
                t = decodeURIComponent(o);
                for (var c = 0; c < 256; c++)
                  e[c] = c;
                for (c = 0; c < 256; c++)
                  i = (i + e[c] + n.charCodeAt(c % n.length)) % 256,
                    r = e[c],
                    e[c] = e[i],
                    e[i] = r;
                c = 0,
                  i = 0;
                for (var f = 0; f < t.length; f++)
                  i = (i + e[c = (c + 1) % 256]) % 256,
                    r = e[c],
                    e[c] = e[i],
                    e[i] = r,
                    a += String.fromCharCode(t.charCodeAt(f) ^ e[(e[c] + e[i]) % 256]);
                return a
              }
              ,
              t.aBwsIj = {},
              t.KnuQDT = !0);
            var a = t.aBwsIj[n];
            return void 0 === a ? (void 0 === t.oBOLyG && (t.oBOLyG = !0),
              i = t.fyxzDe(i, r),
              t.aBwsIj[n] = i) : i = a,
              i
          }
            , f = c("0x0", "0Q^3")
            , h = c("0x1", "&zxH")
            , l = c("0x2", "kc36")
            , d = c("0x3", "FsN1")
            , p = c("0x4", "wt6v")
            , g = void 0;
          ("undefined" == typeof window ? "undefined" : i(window)) !== c("0x5", "kWt7") && (g = window);
          var v = {};

          function b() {
            var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Date[c("0xc", "HxY!")]()
              , n = {};
            n[c("0xd", "E7dI")] = function (t, n) {
              return t(n)
            }
              ,
              n[c("0xe", "r[(a")] = function (t) {
                return t()
              }
              ,
              n[c("0xf", "kkhd")] = function (t, n) {
                return t % n
              }
              ,
              n[c("0x10", "l*OF")] = function (t, n, r, e) {
                return t(n, r, e)
              }
              ,
              n[c("0x11", "zgAZ")] = function (t, n) {
                return t(n)
              }
              ,
              n[c("0x12", "gPk6")] = c("0x13", "jhb9");
            var r = n[c("0x14", "#BDR")](String, t)[c("0x15", "mUZ7")](0, 10)
              , e = n[c("0x16", "!LcL")](o)
              , i = n[c("0x17", "OPo!")]((r + "_" + e)[c("0x18", "mpB0")]("")[c("0x19", "*%RS")](function (t, n) {
              return t + n[c("0x1a", "[)ww")](0)
            }, 0), 1e3)
              , u = n[c("0x1b", "BmuK")](s, n[c("0x1c", "kWt7")](String, i), 3, "0");
            return a[n[c("0x1d", "ogP5")]]("" + r + u)[c("0x1e", "v*sR")](/=/g, "") + "_" + e
          }

          function m(t) {
            var n = {};
            return n[c("0x1f", "zrO^")] = function (t, n) {
              return t + n
            }
              ,
              n[c("0x20", "jhb9")](t[c("0x21", "FsN1")](0)[c("0x22", "mUZ7")](), t[c("0x23", "[)ww")](1))
          }

          v[c("0x6", "6axu")] = function (t, n) {
            var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 9999
              , e = {
              hNolq: function (t, n) {
                return t + n
              },
              HSBcF: function (t, n) {
                return t * n
              },
              QsJzw: function (t, n) {
                return t * n
              },
              irUnm: c("0x7", "3hFI"),
              ZRUhv: function (t, n) {
                return t + n
              },
              KcgwS: function (t, n) {
                return t + n
              },
              NcxmC: function (t, n) {
                return t || n
              },
              HWavj: c("0x8", "#BDR")
            };
            t = e.hNolq("_", t);
            var i = "";
            if (r) {
              var a = new Date;
              a.setTime(e.hNolq(a.getTime(), e.HSBcF(e.HSBcF(e.QsJzw(e.QsJzw(r, 24), 60), 60), 1e3))),
                i = e.hNolq(e.irUnm, a.toUTCString())
            }
            g[d][l] = e.hNolq(e.ZRUhv(e.KcgwS(e.KcgwS(t, "="), e.NcxmC(n, "")), i), e.HWavj)
          }
            ,
            v[c("0x9", "&8PU")] = function (t) {
              for (var n = function (t, n) {
                return t + n
              }, r = function (t, n) {
                return t < n
              }, e = function (t, n) {
                return t === n
              }, i = n(t = n("_", t), "="), a = g[d][l].split(";"), o = 0; r(o, a[p]); o++) {
                for (var s = a[o]; e(s.charAt(0), " ");)
                  s = s[f](1, s[p]);
                if (e(s.indexOf(i), 0))
                  return s[f](i[p], s[p])
              }
              return null
            }
            ,
            v[c("0xa", "PA5G")] = function (t, n) {
              t = "_" + t,
                g[h].setItem(t, n)
            }
            ,
            v[c("0xb", "VlH&")] = function (t) {
              return t = "_" + t,
                g[h].getItem(t)
            }
            ,
            t[c("0x3a", "#BDR")] = function () {
              var t = {};
              t[c("0x24", "!jRO")] = function (t, n) {
                return t(n)
              }
                ,
                t[c("0x25", "kWt7")] = function (t, n) {
                  return t(n)
                }
                ,
                t[c("0x26", "kkhd")] = c("0x27", "6axu"),
                t[c("0x28", "3hFI")] = function (t) {
                  return t()
                }
                ,
                t[c("0x29", "jhb9")] = c("0x2a", "7CAL"),
                t[c("0x2b", "#BDR")] = c("0x2c", "!jRO"),
                t[c("0x2d", "&8PU")] = c("0x2e", "OPo!");
              var n = t[c("0x2f", "HxY!")]
                , r = {}
                , e = t[c("0x30", "BmuK")](b);
              return [t[c("0x31", "l*OF")], t[c("0x32", "jFJ8")]][t[c("0x33", "Ayw(")]](function (i) {
                try {
                  var a = c("0x34", "AVSJ") + i + c("0x35", "[)ww");
                  r[a] = v[c("0x36", "6axu") + t[c("0x37", "FsN1")](m, i)](n),
                  r[a] || (v[c("0x38", "!jRO") + t[c("0x39", "3hFI")](m, i)](n, e),
                    r[a] = e)
                } catch (t) {
                }
              }),
                r
            }
        }
      ).call(this, r(1)(t))
    }
      , function (t, n) {
      t.exports = function (t) {
        t = t || 21;
        for (var n = ""; 0 < t--;)
          n += "_~varfunctio0125634789bdegjhklmpqswxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[64 * Math.random() | 0];
        return n
      }
    }
      , function (t, n, r) {
      "use strict";
      t.exports = function (t, n, r) {
        if ("string" != typeof t)
          throw new Error("The string parameter must be a string.");
        if (t.length < 1)
          throw new Error("The string parameter must be 1 character or longer.");
        if ("number" != typeof n)
          throw new Error("The length parameter must be a number.");
        if ("string" != typeof r && r)
          throw new Error("The character parameter must be a string.");
        var e = -1;
        for (n -= t.length,
             r || 0 === r || (r = " "); ++e < n;)
          t += r;
        return t
      }
    }
    ])
};

app.get('/get_anti_content', function (req, res) {
  let {url, count} = req.query;
  if (!count) {
    count = 1;
  }
  let arr = [];
  for (let i = 0; i < count; i++) {
    let anti_result = o()()["messagePackSync"](url);
    arr.push(anti_result);
  }
  res.json(arr);
});



/**
 * 启动服务器
 */
let server = app.listen(config.port, function () {
  console.log('Express server listening on port ' + server.address().port);

  storage.socket = require('./utils/socket')(server, config, redis);
  storage.spider = require('./spider')(storage, config);
  // storage.schedule = require('./spider/schedule')(storage, config);

  /**
   * 微信消息处理
   */
  let wechat = require('./wechat');
  storage.wechatInstance = wechat.newInstance(storage, config.wechat);
  app.use("/wechat", function (req, res, next) {
    return storage.wechatInstance.wechatMiddleware(req, res, next);
  });
});
